views:

527

answers:

4

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.

+1  A: 

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)

Jongsma
+1  A: 

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

Kenny
Yea, like Jongsma said. He was first so carry on. :)
Kenny
+1  A: 

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.

FenderMostro
UIWindow does have such a property on iOS4+
valexa
A: 

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!

Mark Szymanski