獲取父類ViewController


公司要求做一個iPhone app,正在一邊學習一邊做用來記錄工作上遇到的麻煩

場景使用了以下這樣的代碼:

 LoginViewController *loginViewController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil]; 
self.logineNavigationController = [[UINavigationController alloc]initWithRootViewController:loginViewController];


在使用NavigationController后導入根視圖后,如果需要獲取父類viewcontroller的話可以通過以下方式獲得

 NSLog(@"%@---afsa-fsaf-asf-asf-as1",self.navigationController);

NSLog(@"%@---afsa-fsaf-asf-asf-as2",self.parentViewController);

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM