iOS幻灯片菜单导致应用崩溃

时间:2016-01-22 11:02:16

标签: ios objective-c swift

问题

教程已关注http://www.appcoda.com/ios-programming-sidebar-navigation-menu/

我创建了一个应用程序但是当我重命名我的一个ViewControllers时,应用程序现在崩溃了。

堆栈追踪:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<netduma_v2.HostFilteringViewController 0x7fbb52d3dfa0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mapView.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001097cde65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000109246deb objc_exception_throw + 48
    2   CoreFoundation                      0x00000001097cdaa9 -[NSException raise] + 9
    3   Foundation                          0x0000000108e139bb -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
    4   UIKit                               0x0000000109fb4320 -[UIViewController setValue:forKey:] + 88
    5   UIKit                               0x000000010a1e2f41 -[UIRuntimeOutletConnection connect] + 109
    6   CoreFoundation                      0x000000010970e4a0 -[NSArray makeObjectsPerformSelector:] + 224
    7   UIKit                               0x000000010a1e1924 -[UINib instantiateWithOwner:options:] + 1864
    8   UIKit                               0x0000000109fbaeea -[UIViewController _loadViewFromNibNamed:bundle:] + 381
    9   UIKit                               0x0000000109fbb816 -[UIViewController loadView] + 178
    10  UIKit                               0x0000000109fbbb74 -[UIViewController loadViewIfRequired] + 138
    11  UIKit                               0x000000010a000651 -[UINavigationController _layoutViewController:] + 54
    12  UIKit                               0x000000010a000f26 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 462
    13  UIKit                               0x000000010a001098 -[UINavigationController _startTransition:fromViewController:toViewController:] + 126
    14  UIKit                               0x000000010a0022f1 -[UINavigationController _startDeferredTransitionIfNeeded:] + 890
    15  UIKit                               0x000000010a0033af -[UINavigationController __viewWillLayoutSubviews] + 57
    16  UIKit                               0x000000010a1a9ff7 -[UILayoutContainerView layoutSubviews] + 248
    17  UIKit                               0x0000000109edc4a3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
    18  QuartzCore                          0x000000010ff5059a -[CALayer layoutSublayers] + 146
    19  QuartzCore                          0x000000010ff44e70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
    20  QuartzCore                          0x000000010ff44cee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
    21  QuartzCore                          0x000000010ff39475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
    22  QuartzCore                          0x000000010ff66c0a _ZN2CA11Transaction6commitEv + 486
    23  QuartzCore                          0x000000010ff6737c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    24  CoreFoundation                      0x00000001096f9367 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    25  CoreFoundation                      0x00000001096f92d7 __CFRunLoopDoObservers + 391
    26  CoreFoundation                      0x00000001096eef2b __CFRunLoopRun + 1147
    27  CoreFoundation                      0x00000001096ee828 CFRunLoopRunSpecific + 488
    28  GraphicsServices                    0x000000010fe18ad2 GSEventRunModal + 161
    29  UIKit                               0x0000000109e25610 UIApplicationMain + 171
    30  netduma-v2                          0x00000001088d628d main + 109
    31  libdyld.dylib                       0x000000010c76a92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

1 个答案:

答案 0 :(得分:3)

您定义了一个实际上并不存在的连接插座mapView。要么是因为你没有设置VC的类,要么改变了类..

检查您的故事板是否有错误的插座/操作 - 标有(!)