iPhone应用程序在启动时崩溃
问题描述:
我有两个应用程序在xcode中,我想合并,所以我开始了一个新项目,并试图将这两个应用程序放在一起。这是一件非常愚蠢的事情吗?iPhone应用程序在启动时崩溃
该应用程序现在崩溃启动时,我不知道为什么,我99%的网点都连接。它使用xcdatamodel进行存储,并且我导入了正确的框架。
任何人都可以想到其他可能出错的事情吗?
我可以附加一个zip文件与项目中,如果有人不介意看看
任何帮助大量的赞赏!
感谢
这是堆栈跟踪:
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'
答
看起来你在你的主XIB连接到应用程序委托的文本字段。在真正的应用程序委托上没有定义这样的字段,这就是为什么你会收到错误。
答
那是因为你设置的信息plist中的应用,并设置文件所有者,以appDelegate
主要xib
,而主要xib
文件的所有者始终是UIApplication
。可能的解决方案 - 将Object
添加到.xib
,将其类别设置为ppDelegate
类,并连接所有不必要的插座。这对我有效。
你得到的错误是什么? – DexterW 2010-11-01 23:11:32
'NSUnknownKeyException',原因:'[ setValue:forUndefinedKey:]:这个类不是关键字值,它是关键字myTableView的编码规范。 –
benhowdle89
2010-11-01 23:14:08
看起来像您的XIB文件已损坏。 – Roman 2010-11-01 23:45:36