错误 - 线程1:信号SIGABRT SpinCity

时间:2016-03-02 16:37:27

标签: ios objective-c ios-multithreading

我正在为一个显示歌曲标题表的项目制作应用程序,并允许您点击它们以查看有关它的更多详细信息。该项目的名称是SpinCity。

以下是线程异常错误:

//  main.m
//  SpinCity

#import <UIKit/UIKit.h>
#import "AppDelegate.h"

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

控制台输出是:

2016-03-02 11:25:15.036 SpinCity[32877:2988350] -[MasterViewController topViewController]: unrecognized selector sent to instance 0x7f975a6a47d0
2016-03-02 11:25:15.038 SpinCity[32877:2988350] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MasterViewController topViewController]: unrecognized selector sent to instance 0x7f975a6a47d0'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010712de65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000106ba6deb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010713648d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x000000010708390a ___forwarding___ + 970
    4   CoreFoundation                      0x00000001070834b8 _CF_forwarding_prep_0 + 120
    5   SpinCity                            0x00000001066a0acb -[AppDelegate application:didFinishLaunchingWithOptions:] + 235
    6   UIKit                               0x00000001074d11f1 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 272
    7   UIKit                               0x00000001074d2397 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3415
    8   UIKit                               0x00000001074d8cc6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1760
    9   UIKit                               0x00000001074d5e7b -[UIApplication workspaceDidEndTransaction:] + 188
    10  FrontBoardServices                  0x0000000109ea9754 -[FBSSerialQueue _performNext] + 192
    11  FrontBoardServices                  0x0000000109ea9ac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    12  CoreFoundation                      0x0000000107059a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    13  CoreFoundation                      0x000000010704f95c __CFRunLoopDoSources0 + 556
    14  CoreFoundation                      0x000000010704ee13 __CFRunLoopRun + 867
    15  CoreFoundation                      0x000000010704e828 CFRunLoopRunSpecific + 488
    16  UIKit                               0x00000001074d57cd -[UIApplication _run] + 402
    17  UIKit                               0x00000001074da610 UIApplicationMain + 171
    18  SpinCity                            0x00000001066a1fff main + 111
    19  libdyld.dylib                       0x000000010986992d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

有关如何解决此问题的任何想法?

谢谢。

1 个答案:

答案 0 :(得分:0)

很清楚为什么会崩溃:

' - [MasterViewController topViewController]:无法识别的选择器发送到实例0x7f975a6a47d0' ***首先抛出调用堆栈:

调用堆栈显示您正试图在application:didFinishLaunchingWithOptions:方法中调用该方法。