错误是指我的main.m,不知道该怎么做才能修复,尝试了很多。
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
感谢帮助。 这是崩溃日志:
2014-12-31 01:49:28.838 iChat[4855:142422] Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?
2014-12-31 01:49:28.922 iChat[4855:142422] Application windows are expected to have a root view controller at the end of application launch
2014-12-31 01:49:30.342 iChat[4855:142422] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<LoginViewController 0x7f8763d77870> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key forgotPasswordButton.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a627f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010a2c0bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010a627b79 -[NSException raise] + 9
3 Foundation 0x00000001074477b3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x000000010a571e80 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x0000000107b80c7d -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x00000001079dff98 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7 UIKit 0x00000001079e0588 -[UIViewController loadView] + 109
8 UIKit 0x00000001079e07f9 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x0000000107a0f06b -[UINavigationController _layoutViewController:] + 44
10 UIKit 0x0000000107a0f5b5 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 216
11 UIKit 0x0000000107a0f6b4 -[UINavigationController _startTransition:fromViewController:toViewController:] + 92
12 UIKit 0x0000000107a10487 -[UINavigationController _startDeferredTransitionIfNeeded:] + 523
13 UIKit 0x0000000107a10f47 -[UINavigationController __viewWillLayoutSubviews] + 43
14 UIKit 0x0000000107b56509 -[UILayoutContainerView layoutSubviews] + 202
15 UIKit 0x0000000107934973 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 521
16 QuartzCore 0x0000000106bbcde8 -[CALayer layoutSublayers] + 150
17 QuartzCore 0x0000000106bb1a0e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18 QuartzCore 0x0000000106bb187e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
19 QuartzCore 0x0000000106b1f63e _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
20 QuartzCore 0x0000000106b2074a _ZN2CA11Transaction6commitEv + 390
21 UIKit 0x00000001078de022 _afterCACommitHandler + 123
22 CoreFoundation 0x000000010a55cdc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
23 CoreFoundation 0x000000010a55cd20 __CFRunLoopDoObservers + 368
24 CoreFoundation 0x000000010a552b53 __CFRunLoopRun + 1123
25 CoreFoundation 0x000000010a552486 CFRunLoopRunSpecific + 470
26 GraphicsServices 0x000000010bccd9f0 GSEventRunModal + 161
27 UIKit 0x00000001078bb420 UIApplicationMain + 1282
28 iSociety 0x00000001065a8b83 main + 115
29 libdyld.dylib 0x000000010b822145 start + 1
30 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
现在我知道它将来自LoginViewController,因为这是用户登录的初始控制器,但是有一些按钮,用户可以在其中注册&#34;或者&#34;忘记了密码&#34;。起初,每次尝试点击注册时它都会崩溃,但很快就会崩溃。
答案 0 :(得分:0)
如果您可以发布崩溃日志以及问题,那会更好。
但大多数情况下,由于与 XIB / Storyboard 的悬空连接而发生此错误:
删除此连接,其中包含&#34;!&#34;感叹号就可以了。
更新:另一个原因:
如果忘记将初始视图控制器设置为场景的起始点。