Re: Modifying the array of an NSArrayController
Re: Modifying the array of an NSArrayController
- Subject: Re: Modifying the array of an NSArrayController
- From: Henrik Wittland <email@hidden>
- Date: Thu, 6 Nov 2003 18:50:09 +0100
Hello Rene,
NSControllers only register for changenotifications if you BIND to the
value you want the controller to observe.
Like the NSControll subclasses (NSTextField,NSButton,...) which you
would bind to somthing inside a NSController you have
to bind the "contentArray" binding of the NSArrayController;
If your NSArray is a property of your FilesOwner you can establish this
binding with IB.
Access to this property must be key value coding-compliant in your App.
Regards,
Henrik
Am 06.11.2003 um 15:57 schrieb Reni Puls:
Hello all,
I am still trying to understand some basic concepts of the new
controller layer.
If I set an NSMutableArray as the content of an NSArrayController, can
I still make changes to this array and rely on the controller to
notice them? I just wrote a sample program which did this, and the
controller would not notice any added objects (by updating the
associated views) until I called [arrayController rearrangeObjects].
Is this the wrong way to do it? Do I have to use the controller's own
addObject: method for this? I thought the point of the controller
layer was to update the view more or less automatically when the
something in the model is changed. The NSArrayController seems to
create its own array if I don't use setContent:, but I would prefer to
"own" the array myself and keep controller and model separated.
Kind regards,
Rene Puls
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.