2016-10-20 3 views
-1

私は、このボタンをクリックすると、私はエラーを持っている:ボタンncaught例外

 
2016-10-20 18:33:11.229 FoodTracker[30127:1716662] -[FoodTracker.Rating_controller ratingButtonTapped:]: unrecognized selector sent to instance 0x7f86ac905af0 
2016-10-20 18:33:11.648 FoodTracker[30127:1716662] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FoodTracker.Rating_controller ratingButtonTapped:]: unrecognized selector sent to instance 0x7f86ac905af0' 
*** First throw call stack: 
(
    0 CoreFoundation      0x0000000110d7934b __exceptionPreprocess + 171 
    1 libobjc.A.dylib      0x000000010e0da21e objc_exception_throw + 48 
    2 CoreFoundation      0x0000000110de8f34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 
    3 CoreFoundation      0x0000000110cfec15 ___forwarding___ + 1013 
    4 CoreFoundation      0x0000000110cfe798 _CF_forwarding_prep_0 + 120 
    5 UIKit        0x000000010e5abb88 -[UIApplication sendAction:to:from:forEvent:] + 83 
    6 UIKit        0x000000010e7312b2 -[UIControl sendAction:to:forEvent:] + 67 
    7 UIKit        0x000000010e7315cb -[UIControl _sendActionsForEvents:withEvent:] + 444 
    8 UIKit        0x000000010e72ff83 -[UIControl touchesBegan:withEvent:] + 414 
    9 UIKit        0x000000010e618e15 -[UIWindow _sendTouchesForEvent:] + 2043 
    10 UIKit        0x000000010e61a7c3 -[UIWindow sendEvent:] + 4011 
    11 UIKit        0x000000010e5c7a33 -[UIApplication sendEvent:] + 371 
    12 UIKit        0x000000010edb9b6d __dispatchPreprocessedEventFromEventQueue + 3248 
    13 UIKit        0x000000010edb2817 __handleEventQueue + 4879 
    14 CoreFoundation      0x0000000110d1e311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 
    15 CoreFoundation      0x0000000110d0359c __CFRunLoopDoSources0 + 556 
    16 CoreFoundation      0x0000000110d02a86 __CFRunLoopRun + 918 
    17 CoreFoundation      0x0000000110d02494 CFRunLoopRunSpecific + 420 
    18 GraphicsServices     0x0000000112c28a6f GSEventRunModal + 161 
    19 UIKit        0x000000010e5a9f34 UIApplicationMain + 159 
    20 FoodTracker       0x000000010daf4a2f main + 111 
    21 libdyld.dylib      0x0000000111ca368d start + 1 
    22 ???         0x0000000000000001 0x0 + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
+1

ボタンイベントハンドラのコードとそれに関連するすべてのコードを追加することを検討してください。 – alexburtnik

+0

「Rating_controller」から「-ratingButtonTapped:」メソッドを削除したり、名前を変更したりしたと思います。 –

+0

'ratingButtonTapped:' IBActionがあります。これはxib/storyboardにありますが、コードに実装されていません – alexburtnik

答えて

0

あなたのXIB /ストーリーボードに存在するが、コードで実装されていないratingButtonTapped: IBAction、があるはずです。ちょうどあなたのボタンとオープンConnections inspectorタブを選択します。

enter image description here

あなたは自分のクラスで指定されたメソッドを実装したり、実装していないすべてのIBActionsを削除してください。

関連する問題