首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于名为'OverlayView‘的未捕获异常'NSInternalInconsistencyException’,正在终止应用程序

由于名为'OverlayView‘的未捕获异常'NSInternalInconsistencyException’,正在终止应用程序
EN

Stack Overflow用户
提问于 2016-08-20 17:23:52
回答 1查看 777关注 0票数 1

我打算通过Podfile在我新创建的swift xcode项目中使用自定义视图Koloda。在pod install后,在Main.storyboard中创建KolodaView并构建成功后,运行时会报告异常,如下所示:

代码语言:javascript
复制
2016-08-20 09:44:38.918 MsgNotFree[25760:2220650] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/jasonzhu/Library/Developer/CoreSimulator/Devices/DDE42B9D-6304-4552-AD30-A1BFA3A7B3E0/data/Containers/Bundle/Application/D1282CEB-9914-4C37-BCD2-DC05675C9FD1/MsgNotFree.app> (loaded)' with name 'OverlayView''
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010a227d85 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010c8d4deb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010a227cbd +[NSException raise:format:] + 205
    3   UIKit                               0x000000010b720c89 -[UINib instantiateWithOwner:options:] + 499
    4   UIKit                               0x000000010b723415 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 223
    5   MsgNotFree                          0x0000000109eedd90 _TFC10MsgNotFree19FirstViewController6kolodafTCS_10KolodaView25viewForCardOverlayAtIndexSu_GSqCS_11OverlayView_ + 368
    6   MsgNotFree                          0x0000000109eedf92 _TToFC10MsgNotFree19FirstViewController6kolodafTCS_10KolodaView25viewForCardOverlayAtIndexSu_GSqCS_11OverlayView_ + 66
    7   MsgNotFree                          0x0000000109eee918 _TTDFC10MsgNotFree19FirstViewController6kolodafTCS_10KolodaView25viewForCardOverlayAtIndexSu_GSqCS_11OverlayView_ + 56
    8   MsgNotFree                          0x0000000109eee085 _TTWC10MsgNotFree19FirstViewControllerS_20KolodaViewDataSourceS_FS1_6kolodafTCS_10KolodaView25viewForCardOverlayAtIndexSu_GSqCS_11OverlayView_ + 53
    9   Koloda                              0x0000000109ff14f5 _TFC6Koloda10KolodaView13configureCardfTCS_17DraggableCardView7atIndexSu_T_ + 501
    10  Koloda                              0x0000000109ff15b2 _TToFC6Koloda10KolodaView13configureCardfTCS_17DraggableCardView7atIndexSu_T_ + 66
    11  Koloda                              0x0000000109ff1183 _TFC6Koloda10KolodaView17createCardAtIndexfTSu5frameGSqVSC6CGRect__CS_17DraggableCardView + 611
    12  Koloda                              0x0000000109ff292b _TFC6Koloda10KolodaViewP33_DFF55D12D516409CF60937DD60F8B8969setupDeckfT_T_ + 955
    13  Koloda                              0x0000000109ff1e60 _TFC6Koloda10KolodaViewW10dataSourceXwGSqPS_20KolodaViewDataSource__ + 32
    14  Koloda                              0x0000000109ff1f60 _TFC6Koloda10KolodaViews10dataSourceXwGSqPS_20KolodaViewDataSource__ + 160
    15  MsgNotFree                          0x0000000109eec73e _TFC10MsgNotFree19FirstViewController11viewDidLoadfT_T_ + 398
    16  MsgNotFree                          0x0000000109eec802 _TToFC10MsgNotFree19FirstViewController11viewDidLoadfT_T_ + 34
    17  UIKit                               0x000000010b4f3984 -[UIViewController loadViewIfRequired] + 1198
    18  UIKit                               0x000000010b4f3cd3 -[UIViewController view] + 27
    19  UIKit                               0x000000010b5571bc -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 502
    20  UIKit                               0x000000010b556130 -[UITabBarController transitionFromViewController:toViewController:] + 59
    21  UIKit                               0x000000010b551f41 -[UITabBarController _setSelectedViewController:] + 377
    22  UIKit                               0x000000010b551db7 -[UITabBarController setSelectedViewController:] + 234
    23  UIKit                               0x000000010b408680 +[UIView(Animation) performWithoutAnimation:] + 65
    24  UIKit                               0x000000010b54bddc -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 344
    25  UIKit                               0x000000010b54d5df -[UITabBarController viewWillAppear:] + 193
    26  UIKit                               0x000000010b4f92bd -[UIViewController _setViewAppearState:isAnimating:] + 710
    27  UIKit                               0x000000010b4f9958 -[UIViewController __viewWillAppear:] + 149
    28  UIKit                               0x000000010b401255 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 633
    29  UIKit                               0x000000010b40fc9e -[UIView(Internal) _addSubview:positioned:relativeTo:] + 481
    30  UIKit                               0x000000010b3ca29a -[UIWindow addRootViewControllerViewIfPossible] + 803
    31  UIKit                               0x000000010b3ca69d -[UIWindow _setHidden:forced:] + 282
    32  UIKit                               0x000000010b3dc180 -[UIWindow makeKeyAndVisible] + 42
    33  UIKit                               0x000000010b350ed9 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
    34  UIKit                               0x000000010b357568 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1769
    35  UIKit                               0x000000010b354714 -[UIApplication workspaceDidEndTransaction:] + 188
    36  FrontBoardServices                  0x000000010d40f8c8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
    37  FrontBoardServices                  0x000000010d40f741 -[FBSSerialQueue _performNext] + 178
    38  FrontBoardServices                  0x000000010d40faca -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    39  CoreFoundation                      0x000000010a14d301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    40  CoreFoundation                      0x000000010a14322c __CFRunLoopDoSources0 + 556
    41  CoreFoundation                      0x000000010a1426e3 __CFRunLoopRun + 867
    42  CoreFoundation                      0x000000010a1420f8 CFRunLoopRunSpecific + 488
    43  UIKit                               0x000000010b353f21 -[UIApplication _run] + 402
    44  UIKit                               0x000000010b358f09 UIApplicationMain + 171
    45  MsgNotFree                          0x0000000109eec272 main + 114
    46  libdyld.dylib                       0x00000001112d892d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

其中,OverlayView类可以在ViewController中引用,这意味着第三方类在项目级别被正确引用。

演示项目是here

谁能给我一些提示,问题可能出在哪里?非常感谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-20 17:34:59

这个错误是由于您的包中没有名为.xib的OverlayView文件,请创建一个新文件-> UserInterface ->查看-> (将其重命名为OverlayView)现在获取overlayView并选择View there将其类更改为OverlayView。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39052501

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档