Re: NSArrayController using an external NSArray?
Re: NSArrayController using an external NSArray?
- Subject: Re: NSArrayController using an external NSArray?
- From: Todd Heberlein <email@hidden>
- Date: Thu, 19 Apr 2007 20:02:54 -0700
On Apr 19, 2007, at 5:25 PM, Ron Aldrich wrote:
[[self mutableArrayValueForKey: @"myArray"] addObject: anObject];
Unfortunately, this did not work either. My array was updated
correctly, but the information was still not showing up the in the
NSTableView which is bound to the NSControllerArray. The
documentation all points this way, so I must still be doing something
wrong.
As a work around, I added to my model a pointer to the
NSArrayController and sent it the addObject: method. In other words,
I went from:
[myArray addObject: anObject];
to
[myArrayController addObject: anObject];
It seems really kludgy (my model shouldn't know about the controller,
IMHO), but it did correctly update both the NSTableView and my
NSMutableArray.
Oh well...
Todd
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden