Re: Has anyone any experience with NSTableView and NSArrayController ?
Re: Has anyone any experience with NSTableView and NSArrayController ?
- Subject: Re: Has anyone any experience with NSTableView and NSArrayController ?
- From: Jeff Gilbert <email@hidden>
- Date: Fri, 08 Oct 2004 09:07:03 -0500
On Friday, October 08, 2004, at 04:08AM, Vincent Coetzee <email@hidden> wrote:
>
Hi there
>
>
I have an NSArrayController that is bound to the columns in an
>
NSTableView. The table view correctly picks up the values that are in
>
the array managed by the controller when it initially displays, but
>
does not update when I add new objects to the array. All other
>
functionality seems fine. Are there any known issues with using an
>
NSArrayController with an NSTableView. Visual inspection of the array
>
managed by the NSArrayController shows that the added values are in
>
fact there, attempting to force the table view to reload it's data by
>
means of reloadData also has no effect. Does anyone have any
>
suggestions ?
>
>
Thanks in advance
>
>
Vincent
You can find some useful information on mmalc's excellent bindings website:
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
Look for the section titled "Programmatic modifications to arrays not noticed by table view". Basically, calling [array addObjects:someObjects] will not cause the array controller to be notified of the change to array. The technique I use is to call:
[[self mutableArrayValueForKey:@"array"] addObjects:someObjects]
Good luck,
Jeff Gilbert
_______________________________________________
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