I know there are a lot similar questions and answers to this one, but I do not get it working. I want to pass the cellnumber in didSelectRowAtIndexPath (in MasterViewController) to viewDidLoad (in DetailViewController). Here is what I have:
//MasterViewController.m:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell=[tableView cellForRowAtIndexPath:indexPath];
NSInteger num = indexPath.row;//cell.tag;
DetailViewController *Second = [[DetailViewController alloc] init];
Second.number = num;
}
//DetailViewController.m:
- (void)viewDidLoad
{
[super viewDidLoad];
if(number == 0){
//show something
} else if(number == 1){
//show something else
}
[self configureView];
}
How must I do this?