• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: anObject? editing cell in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >anObject? editing cell in NSTableView (From: Eric Blom <email@hidden>)

  • Prev by Date: Re: Drag and drop in the same view?
  • Next by Date: Re: Delegate's methods of NSTextFields aren't called
  • Previous by thread: anObject? editing cell in NSTableView
  • Next by thread: Getting GUI objects set up in AppleScript Studio
  • Index(es):
    • Date
    • Thread