Re: when automatically prepares content doesn't
Re: when automatically prepares content doesn't
- Subject: Re: when automatically prepares content doesn't
- From: Keary Suska <email@hidden>
- Date: Sat, 17 Jun 2006 12:55:24 -0600
on 6/16/06 12:47 PM, email@hidden purportedly said:
> Let's say I have an NSArrayController bound to MyObject's "thing", which is
> an NSMutableArray ivar. And let's say I bind columns of an NSTableView to
> that, in the usual way.
>
> My experiments show that if I call the NSArrayController's "add" and edit
> values in the table, the NSMutableArray is created (and it gets a dictionary
> with the correct keys and values).
>
> But if I implement the keyed accessors to "thing" in MyObject, this stops
> working. I must initialize "thing" myself (e.g. in MyObject's awakeFromNib).
> This is even though "automatically prepares content" is checked.
I'll chime in here as a sympathizer to frustrations relating (especially) to
bindings and collection ivars.
My understanding is that "automatically prepares content" is used *instead*
of a content binding or outlet. If you set both, I don't know if the
behavior is defined. This may be where the problem lies.
AFAIK, in auto mode, the controller instantiates it's own NSMutableArray to
contain objects as specified in "object class name". In your example, I
would assume that this means that the controller's "thing" is different from
MyObject's "thing". You could get the controller's "thing" through the
-content method, but I don't think there is any automatic way to synch
objects when using auto mode.
Hope this helps,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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