iOS 5 Storyboard:NavigationViewController 到 TabbarController - 不起作用,为什么?

发布于 2025-01-04 05:05:04 字数 663 浏览 2 评论 0原文

我正在使用带有 Storyboard 的 iOS5,我的场景如下所示:

NavigationCOntroller ->(Nav view 1) TableViewController -> TabBarController ->(Tab1)TableViewController 同样,我在 TabBarController 下有更多选项卡。

现在,当用户单击 TableViewCOntroller 中的任何行时,我会转到 Tab1,并且在 PerformingSegue 之前,我想将一些数据发送到我的 Tab1(TableViewController),如下所示

MyTableVController *tvc = segue.destinationViewController;
tvc.selectedObject =  currentObject;

[UITabBarController setSelectedObject:]: 无法识别的选择器发送到实例 0x68c9450

现在为什么它假设 ' MyTableVController' 是一个 UITabBarController 并正在搜索 setSelectedObject 方法???

在这种情况下如何将数据传递到我的 TableViewCOntroller ?

谢谢。

I am using iOS5 with Storyboard and my scenes are like this :

NavigationCOntroller ->(Nav view 1) TableViewController -> TabBarController ->(Tab1)TableViewController
and similarly I more tabs under my TabBarController.

Now I go to Tab1 when user clicks on any row in my TableViewCOntroller and before PerformingSegue I want to send some data to my Tab1(TableViewController) like this

MyTableVController *tvc = segue.destinationViewController;
tvc.selectedObject =  currentObject;

[UITabBarController setSelectedObject:]: unrecognized selector sent to instance 0x68c9450

Now why is it assuming that 'MyTableVController' is a UITabBarController and searching for setSelectedObject method ???

And how can I pass data to my TableViewCOntroller in this scenario ?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别想她 2025-01-11 05:05:04

好的,我已经找到了我的问题的解决方案,我确实喜欢这样

UITabBarController *tabController  = (UITabBarController *)segue.destinationViewController;
     MyTableVController *tvc = (MyTableVController *)[viewControllers objectAtIndex:0];

,这就是您如何拥有所需的视图控制器并将数据传递给它的方式。

OK I have found solution to my problem , I did like this

UITabBarController *tabController  = (UITabBarController *)segue.destinationViewController;
     MyTableVController *tvc = (MyTableVController *)[viewControllers objectAtIndex:0];

And thats how you have your required viewcontroller and pass data to it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文