MY PROBLEM: when the user a certain cell to select a player, I want the rest of the information related to that player to show up on the new view controller
So far my method looks like this:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
IPlayerViewController *detailViewController = [[IPlayerViewController alloc] initWithNibName:@"IPlayerViewController.h" bundle:nil];
Player *playerF = [playerArray objectAtIndex:indexPath.row];
detailViewController.PlayerLabel.text=playerF.Name;
[self.navigationController pushViewController:detailViewController animated:YES];
}
However the PlayerLabel that i created in IPlayerViewController (and connected the UILabel to the label in storyboard) is blank.
If this looks familiar it is because i am following the following tutorial, but trying to add my own things. Thanks a lot! http://www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1
EDIT: I am USING storyboard. However, in the predefined method, xcode came with the following comment to initialize with Nib Name which threw me off.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
/*
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
*/
}
So it seems like I should use prepareForSegue. Is this something I call in the didSelectRowAtIndexPath or do i ignore that method?