在到达我的代码xcode6.1 Universal app Objective-C NSKeyedUnarchiver



应用程序在7.1模拟器或设备下运行时崩溃,在8.1 中两者都运行良好

带StackTrace:

appName[10676:607] *** -[NSKeyedUnarchiver initForReadingWithData:]: data is empty; did you forget to send -finishEncoding to the NSKeyedArchiver?
appName[10676:607] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '(null)'
*** First throw call stack:
(
    0   CoreFoundation                      0x007a91e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x005258e5 objc_exception_throw + 44
    2   CoreFoundation                      0x007a8fbb +[NSException raise:format:] + 139
    3   UIKit                               0x01064b7b -[UINib instantiateWithOwner:options:] + 951
    4   UIKit                               0x013138bd -[UIStoryboard instantiateViewControllerWithIdentifier:] + 220
    5   UIKit                               0x01313a36 -[UIStoryboard instantiateInitialViewController] + 74
    6   UIKit                               0x00daf6ac -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 79
    7   UIKit                               0x00daf949 -[UIApplication _loadMainInterfaceFile] + 245
    8   UIKit                               0x00dae54e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 543
    9   UIKit                               0x00dc2f92 -[UIApplication handleEvent:withNewEvent:] + 3517
    10  UIKit                               0x00dc3555 -[UIApplication sendEvent:] + 85
    11  UIKit                               0x00db0250 _UIApplicationHandleEvent + 683
    12  GraphicsServices                    0x02e83f02 _PurpleEventCallback + 776
    13  GraphicsServices                    0x02e83a0d PurpleEventCallback + 46
    14  CoreFoundation                      0x00724ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    15  CoreFoundation                      0x007249db __CFRunLoopDoSource1 + 523
    16  CoreFoundation                      0x0074f68c __CFRunLoopRun + 2156
    17  CoreFoundation                      0x0074e9d3 CFRunLoopRunSpecific + 467
    18  CoreFoundation                      0x0074e7eb CFRunLoopRunInMode + 123
    19  UIKit                               0x00dadd9c -[UIApplication _run] + 840
    20  UIKit                               0x00daff9b UIApplicationMain + 1225
    21  appName                       0x000d3e48 main + 136
    22  libdyld.dylib                       0x02a766d9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

一旦出现此错误,我将立即使用VersionControl。我确实回到了以前的提交,但错误不断出现。我确信这在我的代码中没有任何内容。

我还使用Xcode 4.3.x-NSKeyedUnarchiver Exception 尝试了构建iOS 3.0通用应用程序的所有解决方案

但由于它已经2年了,我使用xcode6.1,它不起作用。

iOS8中引入的UniversialStoryboard适用于iPhone和iPad8以及iPad7,但不适用于iPhone 7(仅当不创建任何iPad大小的布局时)

我通过使用引用不同情节提要的plist键Main sroryboard file base name (iPhone)Main sroryboard file base name (iPad)以及引用默认情节提要的iPhone来解决问题,以避免任何其他问题

最新更新