`

引用navigationController对象

 
阅读更多

 

我以前在一个controller中引用一个naviController总是要通过delegate来取得:

 

[[[[UIApplication sharedApplication] delegate ] naviController] pushViewController: printView animated:TRUE];

 

 

今天在源代码中发现有注释是这样的:

 

@property(nonatomic,readonly,retain) UINavigationController *navigationController; // If this view controller has been pushed onto a navigation controller, return it.
 

发现在控制器中就直接有这个对象属性了:

 

[self.navigationController pushViewController: printView animated:TRUE];

 

[self.navigationController presentModalViewController:self.worldCitiesListNavigationController animated:YES];

 

不知道的东西太多了。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics