TabbarController 在 3.0 中崩溃

发布于 2024-11-28 02:51:15 字数 490 浏览 1 评论 0原文

我正在使用 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'

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; //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'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

惜醉颜 2024-12-05 02:51:15

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

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

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.

一萌ing 2024-12-05 02:51:15

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

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

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

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文