• 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: Confused about bindings and NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Confused about bindings and NSTableView


  • Subject: Re: Confused about bindings and NSTableView
  • From: "John C. Randolph" <email@hidden>
  • Date: Wed, 8 Dec 2004 09:54:56 -0800

On Dec 8, 2004, at 8:53 AM, Juan Pablo Pertierra wrote:



It seems, though, that you should not be binding to an NSMutableArray, but rather an NSArrayController.

I didn't explain it correctly in my email, but yes I did bind it to an NSArrayController. I did it exactly like it is done in the "fiendishthngs" Apple example, and I double checked it with the cocoadevcentral article you posted. The bindings are there, but I can't add to the table directly by doing [array addObject:object] because it won't update the table automatically. And if I add the insertObect... and removeObject.... methods then it works but I get the error "Illegal NSTableView data source.....".
Don't add objects to the array directly, tell the controller to add them. See the docs for -insert:, -insertObject:atArrangedObjectIndex:, etc.

-jcr



John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Confused about bindings and NSTableView (From: Juan Pablo Pertierra <email@hidden>)
 >Re: Confused about bindings and NSTableView (From: August Trometer <email@hidden>)
 >Re: Confused about bindings and NSTableView (From: Juan Pablo Pertierra <email@hidden>)

  • Prev by Date: Re: Confused about bindings and NSTableView
  • Next by Date: Re: NSView not resizing when parent view resizes
  • Previous by thread: Re: Confused about bindings and NSTableView
  • Next by thread: Re: Confused about bindings and NSTableView
  • Index(es):
    • Date
    • Thread