2011-01-07 28 views
0

まず、私はiPhone開発の初心者であり、おそらく明らかに欠けていると言いたいと思います。ボタンが押されたときにアプリケーションがクラッシュする

私はビューベースのアプリケーションを持っています。私は "MainWindow.xib"に行き、 "Nib Name"を "MainMenu"に変更しました。これは私のアプリのメニューのxibの名前です。私は、アクション(showWordChooser)に接続されたボタンがあり、ボタンが押されるたびにアプリケーションがクラッシュします。

デバッガ内容:

2011-01-07 15:56:01.987 NCEAVerbs[20479:207] -[NCEAVerbsViewController showWordChooser]: unrecognized selector sent to instance 0x4b251c0 
2011-01-07 15:56:01.990 NCEAVerbs[20479:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NCEAVerbsViewController showWordChooser]: unrecognized selector sent to instance 0x4b251c0' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x00da7be9 __exceptionPreprocess + 185 
    1 libobjc.A.dylib      0x00efc5c2 objc_exception_throw + 47 
    2 CoreFoundation      0x00da96fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 
    3 CoreFoundation      0x00d19366 ___forwarding___ + 966 
    4 CoreFoundation      0x00d18f22 _CF_forwarding_prep_0 + 50 
    5 UIKit        0x00012a6e -[UIApplication sendAction:to:from:forEvent:] + 119 
    6 UIKit        0x000a11b5 -[UIControl sendAction:to:forEvent:] + 67 
    7 UIKit        0x000a3647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527 
    8 UIKit        0x000a21f4 -[UIControl touchesEnded:withEvent:] + 458 
    9 UIKit        0x000370d1 -[UIWindow _sendTouchesForEvent:] + 567 
    10 UIKit        0x0001837a -[UIApplication sendEvent:] + 447 
    11 UIKit        0x0001d732 _UIApplicationHandleEvent + 7576 
    12 GraphicsServices     0x0101ca36 PurpleEventCallback + 1550 
    13 CoreFoundation      0x00d89064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 
    14 CoreFoundation      0x00ce96f7 __CFRunLoopDoSource1 + 215 
    15 CoreFoundation      0x00ce6983 __CFRunLoopRun + 979 
    16 CoreFoundation      0x00ce6240 CFRunLoopRunSpecific + 208 
    17 CoreFoundation      0x00ce6161 CFRunLoopRunInMode + 97 
    18 GraphicsServices     0x0101b268 GSEventRunModal + 217 
    19 GraphicsServices     0x0101b32d GSEventRun + 115 
    20 UIKit        0x0002142e UIApplicationMain + 1160 
    21 NCEAVerbs       0x00001b64 main + 102 
    22 NCEAVerbs       0x00001af5 start + 53 
) 
terminate called after throwing an instance of 'NSException' 
sharedlibrary apply-load-rules all 

私はBT行う場合:

(gdb) bt 
#0 0x90a16176 in __kill() 
#1 0x90a16168 in kill$UNIX2003() 
#2 0x90aa889d in raise() 
#3 0x90abe9bc in abort() 
#4 0x99a16fba in __gnu_cxx::__verbose_terminate_handler() 
#5 0x00efc4e7 in _objc_terminate() 
#6 0x99a1515a in __cxxabiv1::__terminate() 
#7 0x99a1519a in std::terminate() 
#8 0x99a15298 in __cxa_throw() 
#9 0x00efc635 in objc_exception_throw() 
#10 0x00da96fb in -[NSObject(NSObject) doesNotRecognizeSelector:]() 
#11 0x00d19366 in ___forwarding___() 
#12 0x00d18f22 in __forwarding_prep_0___() 
#13 0x00012a6e in -[UIApplication sendAction:to:from:forEvent:]() 
#14 0x000a11b5 in -[UIControl sendAction:to:forEvent:]() 
#15 0x000a3647 in -[UIControl(Internal) _sendActionsForEvents:withEvent:]() 
#16 0x000a21f4 in -[UIControl touchesEnded:withEvent:]() 
#17 0x000370d1 in -[UIWindow _sendTouchesForEvent:]() 
#18 0x0001837a in -[UIApplication sendEvent:]() 
#19 0x0001d732 in _UIApplicationHandleEvent() 
#20 0x0101ca36 in PurpleEventCallback() 
#21 0x00d89064 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__() 
#22 0x00ce96f7 in __CFRunLoopDoSource1() 
#23 0x00ce6983 in __CFRunLoopRun() 
#24 0x00ce6240 in CFRunLoopRunSpecific() 
#25 0x00ce6161 in CFRunLoopRunInMode() 
#26 0x0101b268 in GSEventRunModal() 
#27 0x0101b32d in GSEventRun() 
#28 0x0002142e in UIApplicationMain() 
#29 0x00001b64 in main (argc=1, argv=0xbffff08c) at /Developer/Projects/NCEAVerbs/NCEAVerbs-main.m:13 
(gdb) 

を私は本当に何が起こっているか見当がつかない、エラーが「あなたの避難所を意味:)

+0

あなたがペン先名を変更した場合は、おそらくクラス名も変更する必要があります。 – Veeru

答えて

8
-[NCEAVerbsViewController showWordChooser]: unrecognized selector sent to instance 0x4b251c0 

showWordChooserは、あなたが呼んでいる場所には存在しません。

+3

+1が疑わしいときは、エラーメッセージを読んでください –

1

助けてくださいメソッドを定義しませんでした。スペルの間違ったメソッド名をチェックするか、関数を間違ったファイルに配置しましたか?

+0

私はMainMenu.h/mにアクションを配置しました...どこが間違っていますか?これはMainMenu.hでのみ参照されています。& – JJJollyjim

+0

NCEAVerbsViewController.h/.mにある必要があります。 –

+0

ソースコードを投稿すると本当に役立ちますが、今は自分のメソッドが見つからない原因を言うことができません。 – futureelite7

関連する問題