iphone - Dynamic Button Problem: unrecognized selector sent to instance -


I am creating buttons on the dynamic iPhone app


  UIButton * btn = [Sathprkar the UI button: UIButtonTypeRoundedRect]; [BTN SETTITAL: AITAL FORESTAT: UICOntolStateAnimal]; [BTN at Target: SP Action: @Selector (Buttoned) Control events: UICTroEventTouchUpInside]; Touch the touch [button addObject: btn]; ---------- - (minus) buttonTouched: The {} ---------- - [NSCFString buttonTouched:]: unrecognized selector sent to instance 0x592ef70 2010-07-28 08:59: 43.551 DataManager [1707: 207] *** neither came exception 'NSInvalidArgumentException', due to the end because of the application: '- [NSCFString buttonTouched:]: unrecognized selector example sent to 0x592ef70': (0 CoreFoundation *** call in the first place stack 0x02398919 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x024e65de objc_exception_throw + 47 2 CoreFoundation 0x0239a42b - [NSObject (NSObject) doesNotRecognizeSelector:] 187 3 CoreFoundation 0x0230a116 ___forwarding___ + 966 4 CoreFoundation 0x02309cd2 _CF_forwarding_prep_0 + 50 5 UIKit 0x002bce1 4 - [UIApplication sendAction: To: From: forEvent:] + 119 6 UIKit 0x003466c8 - [UIControl Bejenakshn By: ForEvent:] + 67 7 UIKit 0x00348b4a - [UIControl _sendActionsForEvents (internal): withEvent:] 527 8 UIKit 0x003476f7 - [Uikantrol Tochesended: Vithevent:] 458 9 UIKit 0x00534070 _uigesturerekognizerupdteobsserver + 3687 10 CoreFoundation 0x02379d1b __kfruँlup_is_kaling_aut_to_an_abjrhwar_kalbak_fnkshn__ + 27 11 CoreFoundation 0x0230e987 __kfruँlupdubsservers + 295 12 CoreFoundation 0x022d7c17 __kfruँluprun + 1575 13 CoreFoundation 0x022d7280 CFRunLoopRunSpecific + 208 14 CoreFoundation 0x022d71a1 CFRunLoopRunInMode + 97 15 GraphicsServices 0x02bfd2c8 GSEventRunModal + 217 16 GraphicsServices 0x02bfd38d GSEventRun + 115 17 UIKit 0x002cab58 UIApplicationMain + 116 "SIGABRT": 0 18 DataManager 0x00001c4c main + 102 19 DataManager 53 start 0x00001bdd +) 'NSException' program Receiving received signal end is called after throwing an example.  

Any ideas?

Because you include a colon (: ) in your selector logic < Code> addTarget , the recipient must accept a parameter. , Because there is not one way with the name that accepts a parameter there: the order selector does not recognize the @selector (buttonTouched). To resolve this problem, change the method signature to accept the id parameter.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -