Re: Binding NSArrayController to program
Re: Binding NSArrayController to program
- Subject: Re: Binding NSArrayController to program
- From: Hank Heijink <email@hidden>
- Date: Mon, 11 Feb 2008 07:27:00 -0500
You did bind the array to the Model Key Path of the Content Array,
right? That should work, and you shouldn't have to reach directly into
the controller to add/remove objects. Is there anything special about
how you add objects directly to your solutions array?
Hank
On Feb 11, 2008, at 6:21 AM, Hans van der Meer wrote:
There is something I must misunderstand. The goal is to have an
object in the program reacting on some action from the gui by
calculating new rows for a tableview.
The calculating object has a property:
@property(copy) NSMutableArray *solutions;
which is given in IB to the NSArrayController as Model Key Path.
However, adding objects to this solutions variable does nothing in
the tableview coupled to the arraycontroller.
Things change when I give the added objects not to solutions but add
them with:
[solutionsController addObject:...]
The solutionsController being an IBOutlet coupled to the
arraycontroller. Now the objects added are becoming visible in the
table and can be found with [solutionsController arrangedObjects].
But the solutions variable itself stays unaffected by the additions
in spite of the apparent binding to solutions.
I must conclude that the arraycontroller manages its own version of
the array, but what then is the solutions variable doing? I cannot
remove it or the program stops functioning. And what if I would like
to do the change on the solutions variable and propagate it to the
table instead of directly reaching into the arraycontroller?
I must admit being quite confused here.
Hans van der Meer
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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:
@runbox.com
This email sent to email@hidden
Hank Heijink
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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