編譯時我收到以下錯誤信息:無法識別的選擇是在其他類
2011-11-27 14:59:32.049 Storyboard[12104:f803] -[TargetViewController setPeople:]:unrecognized selector sent to instance 0x6d50310
2011-11-27 14:59:32.051 Storyboard[12104:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TargetViewController setPeople:]: unrecognized selector sent to instance 0x6d50310'
*** First throw call stack:
(0x13c5052 0x1556d0a 0x13c6ced 0x132bf00 0x132bce2 0x2877 0x1a9d6 0x1b8a6 0x2a743 0x2b1f8 0x1eaa9 0x12affa9 0x13991c5 0x12fe022 0x12fc90a 0x12fbdb4 0x12fbccb 0x1b2a7 0x1ca9b 0x2508 0x2465)
terminate called throwing an exception
有趣的是,我的TargetViewController甚至沒有一個「人」的屬性(NSMutableArray的)。
我的應用程序的結構是,我有一個tabView控制器與一個tableView有一個detailView,並在第二個選項卡中有一個普通的視圖(targetVieController)與彈出。
(正如你可能會看到我設置了整個事情有一個故事板,也那是我的應用程序的名稱。
快速幫助表示讚賞!
編輯
也許我應該補充說,只要應用程序開始加載,編譯器就會拋出錯誤...
正在關注Michaels和MrMusic的建議,我搜索我的人調用堆棧,並得到這個:
_cmd = SEL 0x6eae setPeople:
(我認爲這只是一個通知,有斷點)
而且,奇怪的是,我有一個包含以「人類的數組「,但它們不會顯示在我的tableview中的其他選項卡中。
回溯:
#0 -[TargetViewController setPeople:] (self=0x6891f90, _cmd=0x6e8e, b=0x689a8d0) at /Developer/Projects/Storyboard/Storyboard/TargetViewController.m:73
#1 0x000027c7 in -[CoverdaleAppDelegate application:didFinishLaunchingWithOptions:] (self=0x6a7a650, _cmd=0x4c796a, application=0xad74840, launchOptions=0x0) at /Developer/Projects/Storyboard/Storyboard/CoverdaleAppDelegate.m:44
#2 0x0001a9d6 in -[UIApplication _callInitializationDelegatesForURL:payload:suspended:]()
#3 0x0001b8a6 in -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:]()
#4 0x0002a743 in -[UIApplication handleEvent:withNewEvent:]()
#5 0x0002b1f8 in -[UIApplication sendEvent:]()
#6 0x0001eaa9 in _UIApplicationHandleEvent()
#7 0x012affa9 in PurpleEventCallback()
#8 0x013991c5 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__()
#9 0x012fe022 in __CFRunLoopDoSource1()
#10 0x012fc90a in __CFRunLoopRun()
#11 0x012fbdb4 in CFRunLoopRunSpecific()
#12 0x012fbccb in CFRunLoopRunInMode()
#13 0x0001b2a7 in -[UIApplication _run]()
#14 0x0001ca9b in UIApplicationMain()
#15 0x00002458 in main (argc=1, argv=0xbffff644) at /Developer/Projects/Storyboard/Storyboard/main.m:16
要捕捉誰或什麼叫僞造的setter,爲什麼不在你的'TargetViewController'中臨時創建一個'setPeople'方法並在那裏設置一個斷點? –
已經做了...沒有錯誤。如果我在那裏留下了一個空的方法,只是「setPeople」,我沒有得到任何警告,但我的數組(「人」),我用來填寫我的應用程序代表現在是空的... – Faser
在setPeople中設置斷點並查看調用臺讓我們瞭解一下誰/試圖設置人。 – SundayMonday