Re: anObject? editing cell in NSTableView
Re: anObject? editing cell in NSTableView
- Subject: Re: anObject? editing cell in NSTableView
- From: Nick Zitzmann <email@hidden>
- Date: Sat, 29 Mar 2003 07:49:16 -0800
On Friday, March 28, 2003, at 08:20 PM, Eric Blom wrote:
I have found some helpful information in the archives of this list and
in the documentation but I'm struggling to understand what I'm sure is
a basic principal of Cocoa programming. What does "anObject" mean in
example code and how do I use it?
It's actually quite simple... In the table view data source protocol,
the method:
- (void)tableView:(NSTableView *)aTableView
setObjectValue:anObject
forTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex;
"anObject" is of type "id" and contains the modified object. Unless you
manually changed the table view's cell type, this should be an NSString
object. For example, if the table view contained the text "Hello
world!" and then you edited the text to "Hi world!" in the table view,
then the table view will call this method after the editing is
finished, and "anObject" will be an NSString containing the text "Hi
world!".
So then all you have to do is replace the old object with the new
object in your data source, and then you will have an editable table
view...
Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page:
http://dreamless.home.attbi.com/
"Building the future and keeping the past alive are one and the same
thing." - Metal Gear Solid 2
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.