Possible duplicate:
Pass two integers as one integer
Will this work in Objective-C? Pass two integers as one integer
If so, how to do it with NSInteger ?
I ask because I want to calculate a unique NSInteger tag from NSUInteger row and section UITableView ?
See, I am dealing with a UITableViewController that has three sections, each of which has multiple rows. Each row has a UISwitch , and each UISwitch is associated with the same target action method, switchAction:
In switchAction: my plan is to check the sender tag to find out the UISwitch NSIndexPath ( section and row ) UITableView .
So I need two methods:
+ (NSInteger)integerFromInteger1:(NSInteger)int1 integer2:(NSInteger)int2; + (NSIndexPath *)indexPathFromInteger:(NSInteger)integer;
The first method may work better written in C. This also works if you prefer.
source share