I know I’m missing something obvious here but I can’t seem to get my nsinteger stuff write for passing variables and putting them into strings. Here is the part of code that is jacked up.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *chosenCell = [tableView cellForRowAtIndexPath:indexPath];
//need to get the ID number for this guy
NSInteger id_number = chosenCell.tag;
NSLog(@"This is the id number I'm sending to the item list %@", id_number);
NSLog(@"This is the id number I'm sending to the item list %i", id_number);
ItemViewController *vc = [[ItemViewController alloc] initWithPlayer:id_number andGame:gameId];
[[self navigationController] pushViewController:vc animated:YES];
[vc release];
}
The problem is that if I print using the %@ it works properly, however it really shouldn’t as this is not an object that is being printed but an integer. If I use the integer call, it functions wrong, giving me a really off the wall integer. This sounds like the answer is just “use %@” but the problem is that in other cases when I tried to use that as the solution(such as on the next controller), I get an exc_bad_access. Please tell me I’m missing something obvious here…
%iwill work, according to Apple’s Documentation.A
UIView‘s tag is an NSInteger, which is what%ispecifies.