简体   繁体   English

Tabbarcontroller在模拟器上工作而不在iOS设备上

[英]Tabbarcontroller is working in simulator not on iOS device

I have created a tab bar controller inside interface builder and i have created all the view controllers for each tab and the tabbarcontroller is embedded inside a navigation controller. 我在界面生成器中创建了一个标签栏控制器,并且为每个标签创建了所有视图控制器,并且tabbarcontroller嵌入在导航控制器中。 everything is working fine in simulator, Tab bar items are all loaded and changing tabs is working too. 在模拟器中一切正常,选项卡栏项目均已加载,并且更改选项卡也正常工作。 Calling [self.viewControllers count]; 调用[self.viewControllers count]; inside tab bar controller returns the correct number of tab bar items eg 5. 内部标签栏控制器返回正确数量的标签栏项目,例如5。

But when i build the same project on iOS device (version 7.1) when the tab bar controller scene is called, it shows empty screen and no tab bar items are displayed in the bar. 但是,当我在调用标签栏控制器场景时在iOS设备(版本7.1)上构建相同的项目时,它显示空白屏幕,并且该栏中没有显示任何标签栏项目。 Calling [self.viewControllers count]; 调用[self.viewControllers count]; returns 0 indeed. 确实返回0。

I can't figure out why the simulator is working as expected and iOS device is not. 我不知道为什么模拟器会按预期运行而iOS设备无法按预期运行。

This is how i get to the tab bar view controller with a push segue from another view controller : 这是我通过另一个视图控制器的推推按钮进入标签栏视图控制器的方式:

- (void)viewDidLoad {
    [super viewDidLoad];
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if(![defaults boolForKey:@"isLoggedOut"])
    {
        dispatch_async(dispatch_get_main_queue(), ^(void){
            [self performSegueWithIdentifier:@"skipLogin" sender:self];
        });
    }
}

Try to a clean build and/or deleting you app form the Device. 尝试重新构建和/或从“设备”中删除您的应用。 sometimes more than one version installed in the device if I changed the app id or something Xcode launch the wrong one in the Device. 有时,如果我更改了应用程序ID或Xcode在设备中启动了错误的版本,则设备中安装了多个版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ios:定时器在模拟器中工作但不在设备上工作 - ios: Timer working in simulator but not on device UIImagePickerController在iOS设备上工作但在iOS模拟器上没有? - UIImagePickerController working on iOS device but not on iOS simulator? iOS Webkit不在设备上工作,但在swift的模拟器上运行 - iOS Webkit not working on device, but works on simulator at swift 背景音频在iOS模拟器上可运行,但不能在设备上运行 - background audio working on iOS simulator but not device 音频和振动在模拟器中工作,而不是在ios设备上 - Audio and vibrate working in simulator not on ios device 自动旋转仅在设备上的模拟器中有效(IOS 7.1) - Autorotation only working in simulator not on device (IOS 7.1) 外部JavaScript在模拟器中工作,但不在ios设备中工作 - External javascript working in simulator but not in ios device free()使用iOS Simulator,但不能在实际设备上使用 - free() working with iOS Simulator but not on real device 本地通知可在ios模拟器上运行,但不能在设备上运行 - Local notifications working on ios simulator but not on device iOS 应用程序链接在设备上不起作用,但在模拟器上打开应用程序 - iOS applink not working on the device but opens app on simulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM