为什么 self.navigationController pushViewController 不起作用? [英] Why won't self.navigationController pushViewController work?
问题描述
我有一个
UIViewController-> UINavigationBar + UITableView
UIViewController-> UINavigationBar + UITableView
稍微解释一下
我是通过 UIBuilder 实现的..
I made it through UIBuilder..
1:使用 XIB 文件创建一个新的 UIViewController
2: 使用 UIBuiler
我放了一个 UINavigationController
3: 然后我把 UITableView
放在 navigationBar
下所以它给了我..
1: Created a New UIViewController
with XIB-file
2: Using UIBuiler
i put a UINavigationController
3: Then i put UITableView
underneath the navigationBar
so it gave me..
A: UIViewController-> UINavigationBar + UITableView
A: UIViewController-> UINavigationBar + UITableView
现在我正在从工作正常的 Web 服务加载 UITableView 中的数据.
Now i am loading the data in UITableView from a Webservice which is working fine.
我再次使用 sam 配置制作了一个 xib
I again made a xib with sam config which is
B: UIViewController-> UINavigationBar + UITableView
B: UIViewController-> UINavigationBar + UITableView
所以现在当我尝试使用下面的代码在视图 A 上推送视图 B 时......它根本不起作用......
So now when i try to push view B on view A using below code...it wont at all work...
SelectSiteViewController *siteViewController = [[SelectSiteViewController alloc] initWithNibName:@"SelectSiteViewController" bundle:nil];
[self.navigationController pushViewController:siteViewController animated:YES];
当我检查 UINavigationController *nav = self.navigation
nav 是 0x0,我假设 NIL.
nav is 0x0 that is i assume NIL.
谁能告诉我这里有什么问题..为什么它是零...我怎样才能让它工作..
Can anybody tell me whats wrong in here.. why is it nil...and how can i make it work..
非常感谢....我真的很感激任何帮助
Thanks a Lot....I would really appreciate any help
推荐答案
在 UIBuilder 中验证文件的所有者是否引用了 UINavigationController.
In UIBuilder verify that UINavigationController is referenced by the File's owner.
这篇关于为什么 self.navigationController pushViewController 不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!