Reputation: 58170
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.
Upvotes: 0
Views: 2836
Reputation: 303
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/
Upvotes: 1
Reputation: 58170
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!
Upvotes: 1
Reputation: 33
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.
Upvotes: 0
Reputation: 1513
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
Upvotes: 1
Reputation: 3373
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)
Upvotes: 2