iPhone 标签栏应用程序崩溃
我有一个使用选项卡栏的应用程序,每当它启动时它就会崩溃并给出以下错误和堆栈跟踪:
2010-04-22 16:15:03.390 iCrushCans[59858:207] *** Terminating app due to uncaught
exception 'NSUnknownKeyException', reason: '[<UIWindow 0x3e051a0>
setValue:forUndefinedKey:]: this class is not key value coding-compliant for the
key rootViewController.'
2010-04-22 16:15:03.392 iCrushCans[59858:207] Stack: (
29680731,
2425423113,
29839809,
305768,
304309,
2957847,
4641908,
29583663,
4636459,
4644727,
2805842,
2844630,
2833204,
2815615,
2842721,
37776729,
29465472,
29461576,
2809365,
2846639
)
提前致谢!
编辑:好的,我已经检查了 IB 和 applicationDidFinishLaunching 方法中的连接,并且没有任何关于 rootviewcontroller 的内容。
I have an application that uses a tab bar and whenever it launches it crashes and gives me the following error and stack trace:
2010-04-22 16:15:03.390 iCrushCans[59858:207] *** Terminating app due to uncaught
exception 'NSUnknownKeyException', reason: '[<UIWindow 0x3e051a0>
setValue:forUndefinedKey:]: this class is not key value coding-compliant for the
key rootViewController.'
2010-04-22 16:15:03.392 iCrushCans[59858:207] Stack: (
29680731,
2425423113,
29839809,
305768,
304309,
2957847,
4641908,
29583663,
4636459,
4644727,
2805842,
2844630,
2833204,
2815615,
2842721,
37776729,
29465472,
29461576,
2809365,
2846639
)
Thanks in advance!
EDIT: Ok, I've checked the connections in IB and the applicationDidFinishLaunching method and nothing there says anything about a rootviewcontroller.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
检查 XIB(接口生成器文件)。此错误通常是由与不再存在的对象的连接(可以从一个对象拖动到另一个对象的连接)引起的。
(不存在的连接会显示为灰色)
Check you XIB (Interface Builder file). This error is usually caused by a connection (those things you can drag from one object to another) to an object that doesn't exist anymore.
(The non-existend connection will be grayed out)
您很可能正在使用 Interface Builder,您的连接之一已正确设置网络。需要更多信息才能给您更好的答案。先查IB,再回复。
干杯,
肯尼
You are most likely using Interface Builder, one of your connections are net set properly. Need more information to give you a better answer. Check IB first, then reply.
Cheers,
Kenny
好的,所以我现在已经修复了它,发生的情况是 XIB 中存在对 rootviewcontroller 的引用,因此我将其删除并将
[window addSubview:tabBarController.view]
添加到 applicaitionDidFinishLaunching 方法中。感谢您的帮助!Ok, so I have it fixed now, what had happened was there WAS a reference to rootviewcontroller in the XIB so I deleted it and added
[window addSubview:tabBarController.view]
to the applicaitionDidFinishLaunching method. Thanks for all your help!我在 rootViewController 上遇到了非常类似的问题。一些寻找它的人可能想看看这篇修复它的帖子:http://just2us.com/2010/09/pitfalls-with-xib-deployment-target/
I had a very similar problem with rootViewController. Some of the people looking for it might want to have a look at this post that fixed it : http://just2us.com/2010/09/pitfalls-with-xib-deployment-target/
嗯,答案就在你的错误日志中。您正在尝试访问 UIWindow 实例中名为“rootViewController”的属性,只有 UIWindow 对象没有这样的属性!
检查您的 IB 连接,或“applicationDidFinishLaunching”方法中的某个位置。
Well, the answer is right there in your error log. You're trying to access a property called 'rootViewController' in an instance of UIWindow, only UIWindow objects don't have such a property!!
Check your IB Connections, or somewhere in your 'applicationDidFinishLaunching' Method.