給UIViewController的UINavigationController屬性賦值的方法

​給UIViewController的UINavigationController屬性賦值的方法:


1 直接給UIViewController.UINavigationController賦值; 


2 通過方法[[UINavigationController allocinitWithRootViewController:UIViewController]賦值;


3 通過方法[self.navigationController pushViewController:_profileVC animated:YES]賦值; 





這樣,後面就可能通過self.navigationController的方式來引用UINavigationController了。

發佈了8 篇原創文章 · 獲贊 3 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章