
这是如何返回null的
UITabbarController* tabbarController = (UITabbarController*) self.tabbarController;NSLog(@"%@",tabbarController);NSLog(@"%@",self.navigationController.tabbarController);
本来就是我想要做的
NSMutableArray *newTabs = [NSMutableArray arrayWithArray:[self.tabbarController vIEwControllers]];NSLog(@"\n\n\n%lu\n\n\n",(unsigned long)[newTabs count]);NSLog(@"self.tabbarController.vIEwControllers %@ \n\n",self.tabbarController);[newTabs removeObjectAtIndex: 1];[self.tabbarController setVIEwControllers:newTabs];
为什么我会变空?
解决方法 返回null的原因是self是你的UITabbarController,因此,它在self.tabbarController上没有任何东西您的代码应如下所示:
NSMutableArray *newTabs = [NSMutableArray arrayWithArray:[self vIEwControllers]];NSLog(@"\n\n\n%lu\n\n\n",(unsigned long)[newTabs count]);NSLog(@"self.vIEwControllers %@ \n\n",self);[newTabs removeObjectAtIndex: 1];[self setVIEwControllers:newTabs];总结
以上是内存溢出为你收集整理的ios – TabBarController返回null全部内容,希望文章能够帮你解决ios – TabBarController返回null所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)