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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Mac OS X Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-03-2009, 11:21 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 50
Default NSTableView and Cells

Hello All,
I am new to MAC development. I have a situation where I am displaying a number of records in NSTableView (without binding). I have a NSImageCell as one of the cells. Now what I want is that whenever user clicks on NSImageCell then the image should get changed on that particular cell.

Any ideas how should I go about doing this?

Appreciatively,
Mubashir
_mubashir is offline   Reply With Quote
Old 12-03-2009, 11:31 AM   #2 (permalink)
Apple Evangelist
 
sukumar_77's Avatar
 
Join Date: Aug 2008
Location: Mumbai
Posts: 196
Default

Quote:
Originally Posted by _mubashir View Post
Hello All,
I am new to MAC development. I have a situation where I am displaying a number of records in NSTableView (without binding). I have a NSImageCell as one of the cells. Now what I want is that whenever user clicks on NSImageCell then the image should get changed on that particular cell.

Any ideas how should I go about doing this?

Appreciatively,
Mubashir
Hi,

NSImageCell is subclass of NSCell. So please read the class reference for NSCell and check for Managing the Target and Action section.

Hope you are aware of target/action mechanism.
__________________
- Sushil
sukumar_77 is offline   Reply With Quote
Old 12-03-2009, 01:16 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 50
Default

Quote:
Originally Posted by sukumar_77 View Post
Hi,

NSImageCell is subclass of NSCell. So please read the class reference for NSCell and check for Managing the Target and Action section.

Hope you are aware of target/action mechanism.
Thanks for the reply.
I have seen the documentation and here is what I come up with
On my (void)awakeFromNib I have put the following
Code:
[imgCell setAction:@selector(cellClck:)];
Where imgCell is NSCell and cellClck is the target
Code:
-(IBAction)cellClck:(id)sender
{
       ///My Code here
}
But now I am getting exception "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Stub implementation of -setAction by NSCell does nothing."

Any ideas?

Appreciatively,
Mubashir
_mubashir is offline   Reply With Quote
Old 12-03-2009, 09:41 PM   #4 (permalink)
Apple Evangelist
 
sukumar_77's Avatar
 
Join Date: Aug 2008
Location: Mumbai
Posts: 196
Default

Quote:
Originally Posted by _mubashir View Post
Thanks for the reply.
I have seen the documentation and here is what I come up with
On my (void)awakeFromNib I have put the following
Code:
[imgCell setAction:@selector(cellClck:)];
Where imgCell is NSCell and cellClck is the target
Code:
-(IBAction)cellClck:(id)sender
{
       ///My Code here
}
But now I am getting exception "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Stub implementation of -setAction by NSCell does nothing."

Any ideas?

Appreciatively,
Mubashir
Well, actually the code seems to be half done. You will have to specify the target parameter also.

Use following.

Code:
[imgCell setTarget:self];
And your action method must be in the same.
__________________
- Sushil
sukumar_77 is offline   Reply With Quote
Old 12-04-2009, 01:40 AM   #5 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 50
Default

No Luck -

Code:
- (void)awakeFromNib
{
	[imgCell setTarget:self];
	[imgCell setAction:@selector(cellClck:)];
}
Giving the same exception
_mubashir is offline   Reply With Quote
Old 12-08-2009, 11:34 AM   #6 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 50
Default

Any Help - Any one ??
_mubashir is offline   Reply With Quote
Reply

Bookmarks

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: 253
24 members and 229 guests
@sandris, ADY, Dani77, diyora, FAED, fredidf, F_Bryant, GHuebner, HDshot, iDifferent, JasonR, mer10, Oral B, prchn4christ, Rudy, smithdale87, Speed, spiderguy84, stekki, tgjorgoski, Thompson22, Touchmint, twerner, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,753
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

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