Removing NSLog breaks compiler
- by DVG
Okay, so this is weird
I have this code
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.row) {
case 1:
NSLog(@"Platform Cell Selected");
AddGamePlatformSelectionViewController *platformVC =
[[AddGamePlatformSelectionViewController alloc]
initWithNibName:@"AddGamePlatformSelectionViewController" bundle:nil];
platformVC.context = context;
platformVC.game = newGame;
[self.navigationController pushViewController:platformVC animated:YES];
[platformVC release];
break;
default:
break;
}
}
Which works fine.
When I remove the NSLog Statement, like so:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.row) {
case 1:
//NSLog(@"Platform Cell Selected");
AddGamePlatformSelectionViewController *platformVC =
[[AddGamePlatformSelectionViewController alloc]
initWithNibName:@"AddGamePlatformSelectionViewController" bundle:nil];
platformVC.context = context;
platformVC.game = newGame;
[self.navigationController pushViewController:platformVC animated:YES];
[platformVC release];
break;
default:
break;
}
}
I get the following compiler errors
/Users/DVG/Development/iPhone/Backlog/Classes/AddGameTableViewController.m:102:0 /Users/DVG/Development/iPhone/Backlog/Classes/AddGameTableViewController.m:102: error: expected expression before 'AddGamePlatformSelectionViewController'
/Users/DVG/Development/iPhone/Backlog/Classes/AddGameTableViewController.m:103:0 /Users/DVG/Development/iPhone/Backlog/Classes/AddGameTableViewController.m:103: error: 'platformVC' undeclared (first use in this function)
If I just edit out the two // for commenting out that line, everything works swimingly.