<分区>
<分区>
我正在使用 master-detail 模板开发 iPad 应用程序,主 tableview
正在将数据传递给第二个 tableviewController
:
目前我拥有的是:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
UITableViewController *secondTableView = [segue destinationViewController];
}
我的问题是。例如,为什么当我尝试访问 secondTableView
中的属性时:
secondTableView.myString = @"goodBye";
我收到这个错误:
Property "myString" not found on object of type "UTableViewController".
我的问题是如何解决此问题,或者是否有解决此错误的方法。
我非常感谢您的帮助
最佳答案
试试这个:
UITableViewController *secondTableView = (UITableViewController*)[segue destinationViewController];
并确保 myString
应声明为属性。
那你应该试试这个
secondViewControllwer *secondView = (secondViewControllwer*)[[secondViewControllwer alloc]init];
并且类名应该以大写开头。
关于iOS:使用 Storyboard在两个 UITableViewController 之间传递数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20576327/
相关文章:
ios - NSMutableArray 是如何在快速枚举中达到这么高的速度的
ios - 在不连接 APNS 的情况下向 Apple 设备发送推送通知
objective-c - Phonegap + Facebook 插件 : Ready Xcodeproj Package for iOs
ios - 方法中返回 Json 对象,无法将 NSDictionary 转换为 Void
ios - 决定使用核心数据或 NSUserDefaults
ios - 在启动时以编程方式为 5 个选项卡栏项目设置选项卡栏标题,其中 4 个嵌入在导航 Controller 中,1 个不是。 objective-c