in storyboard, have root viewcontroller table viewcontroller , viewcontroller. prototype cell, have connected viewcontroller push segue. want navigation in viewcontroller i.e adding button image view etc. changes not apply viewcontroller. problem? have disconnected segue cell, still when click on cell view showed.
-(void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender{ //detail *d = [[detail alloc] init]; if ([[segue identifier] isequaltostring:@"detail"]) { nsindexpath *indexpath = [self.tableview indexpathforselectedrow]; d = [segue destinationviewcontroller]; d.idd = [array2 objectatindex:indexpath.row]; //detailviewcontroller.treedata = [self.ds objectatindex:[self.tableview indexpathforselectedrow].row]; } }
first, make sure it's connected , name of segue matches 1 in code. second, has be:
-(void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender{ if ([[segue identifier] isequaltostring:@"detail"]) { detailviewcontroller *dcv = [[detailviewcontroller alloc] init]; dvc = [segue destinationviewcontroller]; dvc.treedata = [self.ds objectatindex:[self.tableview indexpathforselectedrow].row]; } you have create instance of viewcontroller wanna navigate , assign [segue destinationviewcontroller] , initialize want (fill textfields , so). didn't understand mean detail variable hope helps :)
Comments
Post a Comment