Skip navigation.
 
mlRe: when automatically prepares content doesn't
FROM : Keary Suska
DATE : Sat Jun 17 20:55:24 2006

on 6/16/06 12:47 PM, <email_removed> 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"

Related mailsAuthorDate
mlwhen automatically prepares content doesn't Matt Neuburg Jun 16, 20:47
mlRe: when automatically prepares content doesn't Keary Suska Jun 17, 20:55
mlRe: when automatically prepares content doesn't Matt Neuburg Jun 17, 21:16
mlRe: when automatically prepares content doesn't Keary Suska Jun 18, 01:43