objective c - One TableViewController with 2 sections linking to 1 DetailView? -


so in project have 1 historytableviewcontroller contains 2 sections. 1 section peopleyouowe , other section group of peoplewhooweyou. how able hook 1 tableviewcontroller , link detail view display different data according sections?

try below approach using prepareforsegue -
creat tableview outlet named mytableview

- (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender {  // new view controller using [segue destinationviewcontroller].  // pass selected object new view controller.   nsindexpath *path = [self.mytableview indexpathforselectedrow];   if (path.section == 0)  {      if ([segue.identifier isequaltostring:@"peopleyouowe"])      {          peopleyouowe *peopleyouowevc = segue.destinationviewcontroller;          // can data of cell array[path.row]      }  }  else if (path.section == 1)  {      if ([segue.identifier isequaltostring:@"peoplewhooweyou"])      {          peoplewhooweyou *peoplewhooweyou = segue.destinationviewcontroller;           // can data of cell array[path.row]      }   }   }      

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -