Possible Duplicate:
Pass two integers as one integer
Will this work in Objective-C? Pass two integers as one integer
If so, how do I do it with NSInteger?
I'm asking because I want to calculate a unique NSInteger tag from the NSUIntegers row & section of a UITableView?
See, I'm dealing with a UITableViewController that has three sections, which each have multiple rows. Every row has a UISwitch, and each UISwitch is linked to the same target-action method, switchAction:.
In switchAction:, my plan is to inspect the sender's tag to figure out the UISwitch's NSIndexPath (section & row) of the UITableView.
So, I want two methods like:
+ (NSInteger)integerFromInteger1:(NSInteger)int1 integer2:(NSInteger)int2;
+ (NSIndexPath *)indexPathFromInteger:(NSInteger)integer;
The first method may work better written in C. That works too if you prefer.