Re: NSArrayController usage
Re: NSArrayController usage
- Subject: Re: NSArrayController usage
- From: Alexander Hartner <email@hidden>
- Date: Tue, 29 Nov 2005 22:41:23 +0000
Having read the instruction on the link I understand why I have to
provide the notifications. A basic example would be great though.
There are also many example on the web which simple call [myView
reload] data. (http://www.cocoadevcentral.com/articles/000080.php).
On 23 May 2005, at 04:21, Lee Morgan wrote:
On May 22, 2005, at 11:14 PM, Pierre Chatel wrote:
i'm trying to port portions of my code to use cocoa bindings: more
specifically, NSArrayControllers.
But i've made an afflicting discovery: an array controller is not
aware of changes made to the array programmatically (i mean,
adding or removing objects of the array in your code for example) !
Shouldn't it be a default behavior of NSArrayController ?!
I guess i'll have to subclass the controller class or register for
some events...
How would *you* do that ? ;-)
PS: maybe it's a silly question, but i've come across the same
problem at CocoaDev http://www.cocoadev.com/index.pl?
NSArrayController. Here is an extract:
"Question: if I have an array in the model and I want it to be
displayed in an NSTableView, but items can be added to the array
from other places than the GUI, is an NSArrayController the right
solution? cause if I add items to the array (from another source),
they will not show in the NSTableView, unless I issue a will/
didChangeValueForKey: with my actual array being the key. I.e. if
my NSTableView is set to display "arrangedObjects.name" shouldn't
that then trigger a notify, when new items are added to the array?
You can call [ myView reloadData ]; to update the display
No, because the model which change the array do not know who is
currently showing that array in the GUI -- it should happen
automatically thru bindings..."
To save mmalc the time of pointing to this great link...
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
"Programmatic modifications to arrays not noticed by table view"
- lee
_______________________________________________
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
_______________________________________________
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