-3

好的,

我对 Objective-C 比较陌生。我正在尝试构建一个基本的表视图,它将从我的本地服务器加载数据。数据加载脚本本身可以工作,但是当我尝试使用表视图实现它时,应用程序崩溃并给出线程 1:信号 SIGABRT 错误消息。我尝试调用没有任何内容的retrieveData,但它仍然崩溃。这可能是一个简单的修复。有人可以帮忙吗。

2013-11-10 19:35:38.033 NewApp[4542:70b] -[TableViewController retreiveData]: unrecognized selector sent to instance 0x109265250
2013-11-10 19:35:38.036 NewApp[4542:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TableViewController retreiveData]: unrecognized selector sent to instance 0x109265250'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010188f795 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001015f2991 objc_exception_throw + 43
    2   CoreFoundation                      0x0000000101920bad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x000000010188109d ___forwarding___ + 973
    4   CoreFoundation                      0x0000000101880c48 _CF_forwarding_prep_0 + 120
    5   NewApp                            0x00000001000020fb -[TableViewController viewDidLoad] + 107
    6   UIKit                               0x0000000100340fe4 -[UIViewController loadViewIfRequired] + 562
    7   UIKit                               0x00000001003411bd -[UIViewController view] + 29
    8   UIKit                               0x00000001002888c7 -[UIWindow addRootViewControllerViewIfPossible] + 58
    9   UIKit                               0x0000000100288bd5 -[UIWindow _setHidden:forced:] + 275
    10  UIKit                               0x0000000100291ca2 -[UIWindow makeKeyAndVisible] + 51
    11  UIKit                               0x00000001002500c8 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1449
    12  UIKit                               0x0000000100253be8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 660
    13  UIKit                               0x0000000100264aab -[UIApplication handleEvent:withNewEvent:] + 3092
    14  UIKit                               0x0000000100264f1e -[UIApplication sendEvent:] + 79
    15  UIKit                               0x00000001002552be _UIApplicationHandleEvent + 618
    16  GraphicsServices                    0x0000000103997bb6 _PurpleEventCallback + 762
    17  GraphicsServices                    0x000000010399767d PurpleEventCallback + 35
    18  CoreFoundation                      0x0000000101811819 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
    19  CoreFoundation                      0x00000001018115ee __CFRunLoopDoSource1 + 478
    20  CoreFoundation                      0x000000010183aab3 __CFRunLoopRun + 1939
    21  CoreFoundation                      0x0000000101839f33 CFRunLoopRunSpecific + 467
    22  UIKit                               0x00000001002534bd -[UIApplication _run] + 609
    23  UIKit                               0x0000000100255043 UIApplicationMain + 1010
    24  NewApp                            0x0000000100001fa3 main + 115
    25  libdyld.dylib                       0x0000000101f1e5fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
4

1 回答 1

1

retreiveData正如您所指出的,您调用它似乎很简单,但是根据 Objective-C 运行时,不存在这样的方法,因此调用失败并且您的应用程序崩溃。确保该方法确实存在(它可能只是一个错字,你的意思是retrieveData?!)

于 2013-11-11T00:42:42.533 回答