iOS模拟器执行应用程序,但"崩溃"当按下"按钮"

时间:2014-06-26 08:06:57

标签: ios xcode swift

在Xcode 6 Beta 2上,我构建了一个包含2个viewcontrollers的应用程序。 enter image description here

你可以看到“Button”的动作是打开第二个ViewController。

但是当按下“按钮”时,重点关注Xcode,并向我显示此屏幕: enter image description here 并突出绿色代码行。 我该如何解决?

**请注意,我没有编写任何代码,只是创建了故事板。

控制台:

2014-06-26 01:05:54.957 ColorMatcher[878:11914] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named ADBannerView'
*** First throw call stack:
(
    0   CoreFoundation                      0x00447646 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x01d728e3 objc_exception_throw + 44
    2   CoreFoundation                      0x0044756d +[NSException raise:format:] + 141
    3   UIKit                               0x010f53c0 UINibDecoderDecodeObjectForValue + 317
    4   UIKit                               0x010f5768 UINibDecoderDecodeObjectForValue + 1253
    5   UIKit                               0x010f527b -[UINibDecoder decodeObjectForKey:] + 371
    6   UIKit                               0x00caf579 -[UIView initWithCoder:] + 867
    7   UIKit                               0x010f5566 UINibDecoderDecodeObjectForValue + 739
    8   UIKit                               0x010f527b -[UINibDecoder decodeObjectForKey:] + 371
    9   UIKit                               0x00f64b31 -[UIRuntimeConnection initWithCoder:] + 189
    10  UIKit                               0x010f5566 UINibDecoderDecodeObjectForValue + 739
    11  UIKit                               0x010f5768 UINibDecoderDecodeObjectForValue + 1253
    12  UIKit                               0x010f527b -[UINibDecoder decodeObjectForKey:] + 371
    13  UIKit                               0x00f63927 -[UINib instantiateWithOwner:options:] + 1164
    14  UIKit                               0x00d9274d -[UIViewController _loadViewFromNibNamed:bundle:] + 270
    15  UIKit                               0x00d92ff4 -[UIViewController loadView] + 295
    16  UIKit                               0x00d93222 -[UIViewController loadViewIfRequired] + 72
    17  UIKit                               0x00d9377b -[UIViewController view] + 35
    18  UIKit                               0x013daed5 -[_UIFullscreenPresentationController _setPresentedViewController:] + 75
    19  UIKit                               0x00d6af51 -[UIPresentationController initWithPresentingViewController:presentedViewController:] + 113
    20  UIKit                               0x00d6b005 -[UIPresentationController initWithPresenting:presented:] + 48
    21  UIKit                               0x00da0564 -[UIViewController _presentViewController:withAnimationController:completion:] + 1952
    22  UIKit                               0x00da3061 -[UIViewController presentViewController:animated:completion:] + 333
    23  UIKit                               0x00da31e2 -[UIViewController presentModalViewController:animated:] + 57
    24  UIKit                               0x0124df79 -[UIStoryboardModalSegue perform] + 271
    25  UIKit                               0x0123b8e6 -[UIStoryboardSegueTemplate _perform:] + 217
    26  UIKit                               0x0123b962 -[UIStoryboardSegueTemplate perform:] + 116
    27  libobjc.A.dylib                     0x01d8579d -[NSObject performSelector:withObject:withObject:] + 84
    28  UIKit                               0x00c45fe2 -[UIApplication sendAction:to:from:forEvent:] + 99
    29  UIKit                               0x00c45f74 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
    30  UIKit                               0x00d72876 -[UIControl sendAction:to:forEvent:] + 69
    31  UIKit                               0x00d72c93 -[UIControl _sendActionsForEvents:withEvent:] + 598
    32  UIKit                               0x00d71efd -[UIControl touchesEnded:withEvent:] + 660
    33  UIKit                               0x00c952da -[UIWindow _sendTouchesForEvent:] + 874
    34  UIKit                               0x00c95db5 -[UIWindow sendEvent:] + 791
    35  UIKit                               0x00c5bc29 -[UIApplication sendEvent:] + 242
    36  UIKit                               0x00c6b5e2 _UIApplicationHandleEventFromQueueEvent + 20518
    37  UIKit                               0x00c40cc5 _UIApplicationHandleEventQueue + 2154
    38  CoreFoundation                      0x0036bfaf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    39  CoreFoundation                      0x0036134d __CFRunLoopDoSources0 + 253
    40  CoreFoundation                      0x003608a8 __CFRunLoopRun + 952
    41  CoreFoundation                      0x0036022b CFRunLoopRunSpecific + 443
    42  CoreFoundation                      0x0036005b CFRunLoopRunInMode + 123
    43  GraphicsServices                    0x03d943ca GSEventRunModal + 192
    44  GraphicsServices                    0x03d94207 GSEventRun + 104
    45  UIKit                               0x00c446e5 UIApplicationMain + 1526
    46  ColorMatcher                        0x00002ae1 top_level_code + 97
    47  ColorMatcher                        0x00002b1b main + 43
    48  libdyld.dylib                       0x022b3ac9 start + 1
    49  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

1 个答案:

答案 0 :(得分:2)

您需要链接到iAd库。

单击左侧Project Navigator中的项目。在"目标"下选择您的应用程序。然后在" General"添加" iAd.framework"到#34;链接的框架和图书馆"。