我正在开发一个直到昨天才建好的iOS项目。今天我突然收到一个错误:This coder requires that replaced objects be returned from initWithCoder
。
我尝试搜索论坛,他们提到xib
的格式错误。但是,我的项目根本不使用xib
。
可能是什么问题?这是我的主要功能看起来
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
self.viewController = [[JASidePanelController alloc] init];
self.viewController.shouldDelegateAutorotateToVisiblePanel = NO;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *centerViewController = [storyboard instantiateInitialViewController];
self.viewController.leftPanel = [storyboard instantiateViewControllerWithIdentifier:@"HNLeftPanelViewController"];
self.viewController.centerPanel = centerViewController;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
我发布之前的详细输出以供参考。
2014-04-18 14:26:33.477 Nearby[1315:70b] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'This coder requires that replaced objects be returned from initWithCoder:'
*** First throw call stack:
(
0 CoreFoundation 0x03b935e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x037bf8b6 objc_exception_throw + 44
2 CoreFoundation 0x03b933bb +[NSException raise:format:] + 139
3 UIKit 0x029222ce UINibDecoderDecodeObjectForValue + 785
4 UIKit 0x02921fb1 -[UINibDecoder decodeObjectForKey:] + 114
5 UIKit 0x027cefc8 -[UIRuntimeConnection initWithCoder:] + 191
6 UIKit 0x0292227d UINibDecoderDecodeObjectForValue + 704
7 UIKit 0x0292247e UINibDecoderDecodeObjectForValue + 1217
8 UIKit 0x02921fb1 -[UINibDecoder decodeObjectForKey:] + 114
9 UIKit 0x027ce442 -[UINib instantiateWithOwner:options:] + 1117
10 UIKit 0x02640605 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
11 UIKit 0x02640dad -[UIViewController loadView] + 302
12 UIKit 0x026410ae -[UIViewController loadViewIfRequired] + 78
13 UIKit 0x02666b15 -[UINavigationController _layoutViewController:] + 39
14 UIKit 0x0266702b -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
15 UIKit 0x02667123 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
16 UIKit 0x0266809c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
17 UIKit 0x02668cb9 -[UINavigationController __viewWillLayoutSubviews] + 57
18 UIKit 0x027a2181 -[UILayoutContainerView layoutSubviews] + 213
19 UIKit 0x02598267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
20 libobjc.A.dylib 0x037d181f -[NSObject performSelector:withObject:] + 70
21 QuartzCore 0x017052ea -[CALayer layoutSublayers] + 148
22 QuartzCore 0x016f90d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
23 QuartzCore 0x01705235 -[CALayer layoutIfNeeded] + 160
24 UIKit 0x02653613 -[UIViewController window:setupWithInterfaceOrientation:] + 304
25 UIKit 0x02572177 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 5212
26 UIKit 0x02570d16 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
27 UIKit 0x02570be8 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 117
28 UIKit 0x02570c70 -[UIWindow _setRotatableViewOrientation:duration:force:] + 67
29 UIKit 0x0256fd0a __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 120
30 UIKit 0x0256fc6c -[UIWindow _updateToInterfaceOrientation:duration:force:] + 400
31 UIKit 0x025709c3 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 870
32 UIKit 0x02573fb6 -[UIWindow setDelegate:] + 449
33 UIKit 0x02645737 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 180
34 UIKit 0x02569c1c -[UIWindow addRootViewControllerViewIfPossible] + 609
35 UIKit 0x02569d97 -[UIWindow _setHidden:forced:] + 312
36 UIKit 0x0256a02d -[UIWindow _orderFrontWithoutMakingKey] + 49
37 UIKit 0x0257489a -[UIWindow makeKeyAndVisible] + 65
38 Nearby 0x000421b2 -[HNAppDelegate application:didFinishLaunchingWithOptions:] + 754
39 UIKit 0x02527355 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309
40 UIKit 0x02527b95 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1536
41 UIKit 0x0252c3a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
42 UIKit 0x0254087c -[UIApplication handleEvent:withNewEvent:] + 3447
43 UIKit 0x02540de9 -[UIApplication sendEvent:] + 85
44 UIKit 0x0252e025 _UIApplicationHandleEvent + 736
45 GraphicsServices 0x04f652f6 _PurpleEventCallback + 776
46 GraphicsServices 0x04f64e01 PurpleEventCallback + 46
47 CoreFoundation 0x03b0ed65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
48 CoreFoundation 0x03b0ea9b __CFRunLoopDoSource1 + 523
49 CoreFoundation 0x03b3977c __CFRunLoopRun + 2156
50 CoreFoundation 0x03b38ac3 CFRunLoopRunSpecific + 467
51 CoreFoundation 0x03b388db CFRunLoopRunInMode + 123
52 UIKit 0x0252badd -[UIApplication _run] + 840
53 UIKit 0x0252dd3b UIApplicationMain + 1225
54 Nearby 0x0004b72d main + 141
55 libdyld.dylib 0x04104701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException