Hi,
I'm using Interface Builder (IB).
I have: ViewController.m, ViewController.h and: ViewController.xib:
PHP Code:
@interface ContactsManagementController : UIViewController <UITableViewDelegate, UITableViewDataSource>
in the *.h and *.m i've declared and implemented:
PHP Code:
-(IBAction)onClick:(id)sender;
The ViewController class contains a table in it.
I have cell.h, cell.m and cell.xib for that table.
The File's Owner of the cell is the ViewController class.
In each cell I have button that i want to fire the IBAction that located in the ViewController class.
In the (IB) I've opened cell.xib, selected: "File's Owner" and attached onClick to the button in the cell.
Now, when I'm clicking the button, the app crashes and I'm getting:
2011-02-23 20:43:43.364 B_3[15410:207] -[UIDeviceWhiteColor onClick:]: unrecognized selector sent to instance 0x4d54900
2011-02-23 20:43:43.366 B_3[15410:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDeviceWhiteColor onClick:]: unrecognized selector sent to instance 0x4d54900'
*** Call stack at first throw:
(
0 CoreFoundation 0x010e9be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0123e5c2 objc_exception_throw + 47
2 CoreFoundation 0x010eb6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x0105b366 ___forwarding___ + 966
4 CoreFoundation 0x0105af22 _CF_forwarding_prep_0 + 50
5 UIKit 0x002cda6e -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x0035c1b5 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x0035e647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x0035d1f4 -[UIControl touchesEnded:withEvent:] + 458
9 UIKit 0x00558987 _UIGestureRecognizerSortAndSendDelayedTouches + 3609
10 UIKit 0x005590fc _UIGestureRecognizerUpdateObserver + 927
11 CoreFoundation 0x010cafbb __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK _FUNCTION__ + 27
12 CoreFoundation 0x010600e7 __CFRunLoopDoObservers + 295
13 CoreFoundation 0x01028bd7 __CFRunLoopRun + 1575
14 CoreFoundation 0x01028240 CFRunLoopRunSpecific + 208
15 CoreFoundation 0x01028161 CFRunLoopRunInMode + 97
16 GraphicsServices 0x01a1e268 GSEventRunModal + 217
17 GraphicsServices 0x01a1e32d GSEventRun + 115
18 UIKit 0x002dc42e UIApplicationMain + 1160
19 B_3 0x000020ac main + 102
20 B_3 0x0000203d start + 53
21 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
What should I do?
How can I implement the onClick function in the ViewController class, and have the button in the cell class?
Tnx in advance.