获取父类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