![](/img/trans.png)
[英]How can an instance variable get deallocated in a UITableViewController
[英]How can i get my UITableViewController Instance when Segued?
我有个问题。 我有一个正在为UITableView
实现DatasourceDelegate
的类。
我的TableViewController
是从弹出窗口中UIBarButton
,我已将其设置到工具栏中的UIBarButton
上。 (此工具栏是UINavigationController
一部分)。
我现在的问题是,我UITableviewController
将datasource
对象传递给UITableviewController
。 所以问题是。 如何获取已从导航控制器的工具栏中设置的UITableviewController
的实例?
在上一个viewController中的prepareForSeque方法中,您可以访问segue.destinationViewController。 然后将其转换为所需的内容(UITableViewController *)segue.destinationViewController
以便您可以访问自定义方法来设置数据对象或设置数据委托
就像是
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
SomeClasViewController *vc = [segue destinationViewController];
[vc setDataObject:SomeDataObject];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.