简体   繁体   English

pushViewController的简单问题

[英]simple question of pushViewController

messagecontroller is nothing but object of initialize nib file. messagecontroller只是初始化nib文件的对象。

[self.navigationController pushViewController:messageController animated:YES];

this statement executes in normal condition 该语句在正常条件下执行

this statement also works on state maintainace testing , this line executes properly but not open new view ,why? 该语句也可以用于状态维护测试,该行可以正确执行但不能打开新视图,为什么?

Calling this method call does not push a new view? 调用此方法调用不会推送新视图? If this is the question you should ask yourself some questions: 如果是这个问题,您应该问自己一些问题:

  1. Is self having an UINavigationController ? self有一个UINavigationController吗? Make sure self is a view controller inside a navigation controller. 确保self是导航控制器内部的视图控制器。

  2. Is messageController initialized correctly? messageController是否正确初始化? Like this for example (if messageController is an ivar): 像这样(例如,如果messageController是一个ivar):

     messageController = [[MyViewControllerClass alloc] initWithNibName:@"MyViewControllerClassNibName" bundle:nil]; 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM