Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone TabbarController在3.0中崩溃_Iphone_Objective C_Ios_Uitabbarcontroller_Crash - Fatal编程技术网

Iphone TabbarController在3.0中崩溃

Iphone TabbarController在3.0中崩溃,iphone,objective-c,ios,uitabbarcontroller,crash,Iphone,Objective C,Ios,Uitabbarcontroller,Crash,我正在使用TabBarController,它在我的ipod中运行良好 但是我的应用程序在3.0版上崩溃了。需要帮忙吗 self.window.rootViewController = self.tabBarController; //crashing here 日志显示 -[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x127c80 Terminating app due to uncau

我正在使用
TabBarController
,它在我的ipod中运行良好

但是我的应用程序在3.0版上崩溃了。需要帮忙吗

self.window.rootViewController = self.tabBarController; //crashing here
日志显示

-[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x127c80
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -    
[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x127c80'
我可以告诉你正确的方向。如果问题仍然存在,请告诉我

由于在不同版本的iOS上执行,该方法可能已被弃用。

可能会为您指明正确的方向。如果问题仍然存在,请告诉我


由于在不同版本的iOS上执行,该方法可能已被弃用。

崩溃是因为您调用的方法不存在,而不是因为您的变量未初始化

-setRootViewController
在iOS 4.0之前不存在。使用

[self.window addSubview:self.tabBarController.view];
相反


或者,将目标platfor更新为4.0.2或更高版本。目前可能只有不到5%的用户没有使用iOS 4。

崩溃是因为您调用了一个不存在的方法,而不是因为您的变量没有初始化

-setRootViewController
在iOS 4.0之前不存在。使用

[self.window addSubview:self.tabBarController.view];
相反


或者,将目标platfor更新为4.0.2或更高版本。目前可能只有不到5%的用户没有使用iOS 4。

根据例外情况,您要设置为rootview控制器到窗口的值未初始化或为空。是的,但它在我的ipod中运行良好,仅在3.0中崩溃。实现NSZombieEnabled=是,它将向您显示确切的崩溃原因。在self.window.rootViewController=self.tabBarController中崩溃的原因相同;根据异常情况,您要设置为rootview控制器的值未初始化或为NULL.ya,但它在我的ipod中运行良好,仅在3.0中崩溃。Implement NSZombieEnabled=是,它将显示确切的崩溃原因。在self.window.rootViewController=self.tabBarController中崩溃的原因相同;