How pass data in seque ios5 storyboard uitableview to detail view

后端 未结 5 1046
失恋的感觉
失恋的感觉 2020-12-04 18:47

I\'m creating an app in ios5 using storyboards. I have a tableviewcontroller embedded in a navigation controller and when you click on the cells in the tableviewcontroller s

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-04 19:17

    Try this way

    First Name Your segue(from tableview cell to detail view).Then

    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    
    
        if([segue.identifier isEqualToString:@"yourSegueName"]){
    
            DetailViewController * detailViewController =segue.destinationViewController;
            detailViewController =[self.yourTableViewDataArray objectAtIndex:[self.yourTableView indexPathForSelectedRow].row];
    
        }
    
    }
    

    Don't forget to import your SecondViewController/DetailViewController

提交回复
热议问题