1

应用程序在 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 为 iOS 3.0 构建通用应用程序的所有解决方案 - NSKeyedUnarchiver Exception

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

4

1 回答 1

1

iOS8 中引入的通用故事板适用于 iPhone 和 iPad 8 以及 iPad 7,但不适用于 iPhone 7(仅在不创建任何 iPad 尺寸布局的情况下)

我通过使用 plist-keysMain sroryboard file base name (iPhone)Main sroryboard file base name (iPad)引用不同的 Storyboard 和 iPhone 解决了这个问题,引用了默认值以避免任何其他麻烦

于 2015-02-19T10:55:59.057 回答