开发者

TabbarController crashes in 3.0

开发者 https://www.devze.com 2023-03-26 02:45 出处:网络
i am using TabBarController , it is working fine in my ipod. but my application is crashing it 3.0 . any help please?

i am using TabBarController , it is working fine in my ipod.

but my application is crashing it 3.0 . any help please?

self.window.rootViewController = self.tabBarController开发者_Go百科; //crashing here

and log shows

-[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x127c80
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -    
[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x127c80'


This may show you the right direction. Let me know if the problem still continues.

Due to executing on different versions of iOS, that method may have deprecated.


The crash is because you're calling a method that doesn't exist, not because your variables are not initialized.

-setRootViewController doesn't exist prior to iOS 4.0. Use

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

instead.

Or, update your target platfor to 4.0.2 or later. It's probably less than 5% of users that aren't using iOS 4 at this point.

0

精彩评论

暂无评论...
验证码 换一张
取 消