我使用iOS SDK 4.3在XCode(4.0)中创建了一个新的基于View的iPhone应用程序。然后我将ViewController的名称从MyProjectNameViewController
更改为LoginViewController
。我还用LoginViewController
代替了我能找到的MyProjectNameViewController
的每个实例,并且我已经仔细检查了界面构建器中的所有链接。更改ViewController的名称会导致应用程序崩溃?
然而,当我尝试运行应用程序,它崩溃了:
2011-06-29 10:21:36.927 Monitoring[12580:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<LoginViewController 0x4b26bf0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key password.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc05a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f14313 objc_exception_throw + 44
2 CoreFoundation 0x00dc04e1 -[NSException raise] + 17
3 Foundation 0x00792677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x007925e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x0020e30c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00d368cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x0020cd23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x0020eab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x000c4628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x000c2134 -[UIViewController loadView] + 120
11 UIKit 0x000c200e -[UIViewController view] + 56
12 UIKit 0x00035d42 -[UIWindow addRootViewControllerViewIfPossible] + 51
13 MyProjectName 0x000022c7 -[MyProjectNameAppDelegate application:didFinishLaunchingWithOptions:] + 135
14 UIKit 0x00012c89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
15 UIKit 0x00014d88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
16 UIKit 0x0001f617 -[UIApplication handleEvent:withNewEvent:] + 1533
17 UIKit 0x00017abf -[UIApplication sendEvent:] + 71
18 UIKit 0x0001cf2e _UIApplicationHandleEvent + 7576
19 GraphicsServices 0x00ff9992 PurpleEventCallback + 1550
20 CoreFoundation 0x00da1944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
21 CoreFoundation 0x00d01cf7 __CFRunLoopDoSource1 + 215
22 CoreFoundation 0x00cfef83 __CFRunLoopRun + 979
23 CoreFoundation 0x00cfe840 CFRunLoopRunSpecific + 208
24 CoreFoundation 0x00cfe761 CFRunLoopRunInMode + 97
25 UIKit 0x000147d2 -[UIApplication _run] + 623
26 UIKit 0x00020c93 UIApplicationMain + 1160
27 MyProjectName 0x00002209 main + 121
28 MyProjectName 0x00002185 start + 53
什么我需要做的,解决这一问题?
_I我也替换了每一个我能找到的实例_...我想你错过了一个。 – PengOne
说真的,我一遍又一遍地检查了每一个类,并查看了xibs的源代码,并且没有一个旧的控制器名称的实例。 – DanielGibbs
您是通过手动还是使用重构工具来完成此操作? – Abizern