iPhone app crashes on startup
I had two apps in xcode, which i wanted to combine, so i started a new project and attempted to put the two apps together in this new one. Was this a really stupid thi开发者_开发技巧ng to do?
The app now crashes on start up and i have no idea why, i'm 99% the outlets are all connected. It uses xcdatamodel for storage and i've imported the right framework.
Can anyone think of any other things that could be going wrong?
I can attach a zip file with the project in if someone wouldn't mind having a look
Any help is massively appreciated!
Thanks
This is the stack trace:
2010-11-02 08:18:59.903 iStalker[34745:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x5b10e20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key textField.'
*** Call stack at first throw:
(
0 CoreFoundation 0x0256f919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x026bd5de objc_exception_throw + 47
2 CoreFoundation 0x0256f851 -[NSException raise] + 17
3 Foundation 0x0003bc2b _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0003bb99 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004b5d0a -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x024e5b6f -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004b4721 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004b64b5 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002c59bb -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002c690d -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 198
11 UIKit 0x002d0452 -[UIApplication handleEvent:withNewEvent:] + 1958
12 UIKit 0x002c9074 -[UIApplication sendEvent:] + 71
13 UIKit 0x002cdac4 _UIApplicationHandleEvent + 7495
14 GraphicsServices 0x02dd5afa PurpleEventCallback + 1578
15 CoreFoundation 0x02550dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x024b1737 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x024ae9c3 __CFRunLoopRun + 979
18 CoreFoundation 0x024ae280 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x024ae1a1 CFRunLoopRunInMode + 97
20 UIKit 0x002c6226 -[UIApplication _run] + 625
21 UIKit 0x002d1b58 UIApplicationMain + 1160
22 iStalker 0x00001b50 main + 102
23 iStalker 0x00001ae1 start + 53
)
terminate called after throwing an instance of 'NSException'
Looks like you have a text field connected to the application delegate in your main XIB. There is no such field defined on the real application delegate, which is why you’re getting the error.
Thats because you set main xib
for app in info plist and set File Owner to appDelegate
, while main xib
file's owner is always UIApplication
. Possible solution - add Object
to .xib
, set its class for appDelegate
class and connect all unnecessary outlets. This worked for me.
精彩评论