呈现一个模态视图控制器
我的应用程序的两个不同部分中有相同的代码。 在一个部分中它被完美执行,而在另一部分中它被完全忽略。我设置了一个断点,并观察程序遍历该代码的每一行,而没有加载它应该加载的下一个 xib/类。
这是代码:
UIViewController *nextController = [[ClassNameViewController alloc] initWithNibName:@"MatchingView" bundle:nil];
[nextController performSelector:@selector(setDelegate:) withObject:self];
[self presentModalViewController:nextController animated:YES];
有什么想法为什么这可能会被忽略并且不显示我的 viewController 吗?
I have this same piece of code in two different parts of my app.
In one section it is executed perfectly, and in the other it is completely ignored. I've put in a breakpoint and watched the program go through each line of this code without loading the next xib/class it is supposed to.
Here is the code:
UIViewController *nextController = [[ClassNameViewController alloc] initWithNibName:@"MatchingView" bundle:nil];
[nextController performSelector:@selector(setDelegate:) withObject:self];
[self presentModalViewController:nextController animated:YES];
Any ideas why this might be getting ignored and not presenting my viewController?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用..
Try using ..
我在 viewDidLoad 中有这段代码并将其移动到 viewDidAppear 使其工作。
I had this code in viewDidLoad and moving it to viewDidAppear made it work.