Re: Confused about bindings and NSTableView
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