計算機を作ってみたのですが、ボタンを押すとクラッシュしてしまいます。原因、改善方法を教えてください。
Obhective
1 2- (IBAction)inputNumber1:(id)sender { 3 4 NSInteger num1 = 1; 5 NSString *print = [[NSString alloc] initWithFormat:@"%ld!", (long)num1]; 6 self->kekka.text= print; 7 8}
2016-04-29 16:33:45.296 計算home[5159:954504] -[ViewController calcBmi]: unrecognized selector sent to instance 0x7fcf71473ea0 2016-04-29 16:33:45.686 計算home[5159:954504] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewController calcBmi]: unrecognized selector sent to instance 0x7fcf71473ea0' *** First throw call stack: ( 0 CoreFoundation 0x0000000101a55d85 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x00000001014c9deb objc_exception_throw + 48 2 CoreFoundation 0x0000000101a5ed3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x00000001019a4cfa ___forwarding___ + 970 4 CoreFoundation 0x00000001019a48a8 _CF_forwarding_prep_0 + 120 5 UIKit 0x0000000101e0da8d -[UIApplication sendAction:to:from:forEvent:] + 92 6 UIKit 0x0000000101f80e67 -[UIControl sendAction:to:forEvent:] + 67 7 UIKit 0x0000000101f81143 -[UIControl _sendActionsForEvents:withEvent:] + 327 8 UIKit 0x0000000101f80263 -[UIControl touchesEnded:withEvent:] + 601 9 UIKit 0x0000000101e8099f -[UIWindow _sendTouchesForEvent:] + 835 10 UIKit 0x0000000101e816d4 -[UIWindow sendEvent:] + 865 11 UIKit 0x0000000101e2cdc6 -[UIApplication sendEvent:] + 263 12 UIKit 0x0000000101e06553 _UIApplicationHandleEventQueue + 6660 13 CoreFoundation 0x000000010197b301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 14 CoreFoundation 0x000000010197122c __CFRunLoopDoSources0 + 556 15 CoreFoundation 0x00000001019706e3 __CFRunLoopRun + 867 16 CoreFoundation 0x00000001019700f8 CFRunLoopRunSpecific + 488 17 GraphicsServices 0x00000001052d5ad2 GSEventRunModal + 161 18 UIKit 0x0000000101e0bf09 UIApplicationMain + 171 19 Ë®àÁÆóhome 0x0000000100fc7baf main + 111 20 libdyld.dylib 0x000000010422f92d start + 1 21 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。