Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-23-2011, 01:20 PM   #1 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 9
ofirbt is on a distinguished road
Default Table's cell button onClick crashes the app

Hi,

I'm using Interface Builder (IB).

I have: ViewController.m, ViewController.h and: ViewController.xib:
PHP Code:
@interface ContactsManagementController UIViewController <UITableViewDelegateUITableViewDataSource
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.
ofirbt is offline   Reply With Quote
Old 02-23-2011, 08:43 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

Well, the error message says that onClick is unrecognized by UIDeviceWhiteColor, not your ContactsManagementController class. So obviously you have a zombie situation... although it seems pretty weird that you're somehow overreleasing (or under-retaining) your view controller. But you are.

What does the code that causes your view to get displayed look like?
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 02-27-2011, 02:18 AM   #3 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 9
ofirbt is on a distinguished road
Default

Quote:
Originally Posted by dljeffery View Post
Well, the error message says that onClick is unrecognized by UIDeviceWhiteColor, not your ContactsManagementController class. So obviously you have a zombie situation... although it seems pretty weird that you're somehow overreleasing (or under-retaining) your view controller. But you are.

What does the code that causes your view to get displayed look like?
Sorry for the late response.
The view is created from a nib, so the SDK takes care of its initialization (right?).
ofirbt is offline   Reply With Quote
Reply

Bookmarks

Tags
uitableviewcell

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 374
18 members and 356 guests
Absentia, akphyo, apatsufas, BinHex, cpsclicker, dre, Error404, Gaz, gmarro, jeroenkeij, Kirkout, mottdog, Music Man, PavelMik, teebee74, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:15 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0