0

I'm working on master detail app and i would like to view different detailView of selected row. and to be my question clear i give you example here:

Master Detail


detail 1 >


detail 2 >


the target is when i press [detail 1 >] give me self detailview of detail 1 row. and press [detail 2] give self detailview of detail 2 row. i think it's clear. also add customize buttons, images inside every detail view if possible!!

any help will be appreciated.

HaluCOM
  • 1
  • 2

2 Answers2

0
DetailViewController *detailView = [[DetailViewController alloc]init];
detailView.tagValue = 1;
[self.navigationController pushViewController:detailView animated:YES];

You can send a tag value to detailView and based on this value you can show different views. Like make a property like @property(nonatomic)NSInteger tagValue; in .h class of detailView and synthesize it in .m class. Now you can send the tagValue from master Class like this

Now you can check value of tagValue in DetailViewController and based on this you can create your View. I think it is clear now. But if you still have any issue, you can write your code.

Emil
  • 7,220
  • 17
  • 76
  • 135
Ram
  • 51
  • 1
  • 1
  • 3
  • still same problem. but using your code let me back 2 time and give me an error pushing to detailView: 012-10-25 00:38:36.344 MasterDetail[9607:11303] nested push animation can result in corrupted navigation bar 2012-10-25 00:38:36.710 MasterDetail[9607:11303] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted. 2012-10-25 00:38:36.716 MasterDetail[9607:11303] Unbalanced calls to begin/end appearance transitions for . – HaluCOM Oct 24 '12 at 21:45
  • DetailViewController *detailView = [[DetailViewController alloc]init]; detailView.tagValue = 1; [self.navigationController pushViewController:detailView animated:YES]; – Ram Oct 25 '12 at 03:16
0
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 
{
    DetailViewController *detailView = [[DetailViewController alloc]init];
     
    detailView.tagValue = indexPath.row;
     
    [self.navigationController pushViewController:detailView animated:YES];
}

we need to give detailView.tagValue = indexPath.row;

ZhangChn
  • 3,154
  • 21
  • 41
Ram
  • 51
  • 1
  • 1
  • 3