How to reference tableView from a view controller during a segue

前端 未结 4 606
旧时难觅i
旧时难觅i 2020-12-15 11:35

I\'m new to iOS development, so go easy on me please :)

Using Xcode 4.2 for iOS 5, I\'ve built a view controller in IB, with a tableview inside it linked to a detail

4条回答
  •  借酒劲吻你
    2020-12-15 11:57

    After:

    DetailViewController *detail = [segue destinationViewController];
    

    put in:

    [detail view];
    

    then:

    detail.primary = [datasource objectAtIndex:selectedIndexPath.row];
    
    detail.seconday = [datalist objectForKey:detail.primary];
    

    For some reason, just setting the segue isn't enough to get all the properties set up right. You have to add call view on your destinationViewController.

提交回复
热议问题