Skip to content

Instantly share code, notes, and snippets.

@beelsebob
Created July 5, 2011 16:39
Show Gist options
  • Save beelsebob/1065219 to your computer and use it in GitHub Desktop.
Save beelsebob/1065219 to your computer and use it in GitHub Desktop.
NSString *title = [self loggedIn] ? [self titleForIndexPathAfterLogin:indexPath] : [self titleForRowBeforeLogin:indexPath.row];
NSLog(@"Got back text: %@", title);
...
- (NSString *)titleForIndexPathAfterLogin:(NSIndexPath *)path
{
switch ([path section])
{
case 0:
{
switch ([path row])
{
case 0:
return @"Play";
default:
return @"";
}
}
case 1:
{
NSLog(@"Getting title for row %d", [path row]);
switch ([path row])
{
case 0:
return @"Visit Barracks";
case 1:
return @"Visit Marketplace";
default:
return @"";
}
}
case 2:
{
switch ([path row])
{
case 0:
return @"Log Out";
default:
return @"";
}
}
default:
return @"";
}
}
2011-07-05 17:37:35.787 FS Battles[488:707] Getting title for row 0
2011-07-05 17:37:35.789 FS Battles[488:707] Got back text: (null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment