Re: when automatically prepares content doesn't
Re: when automatically prepares content doesn't
- Subject: Re: when automatically prepares content doesn't
- From: Matt Neuburg <email@hidden>
- Date: Sat, 17 Jun 2006 12:16:51 -0700
- Thread-topic: when automatically prepares content doesn't
On Sat, 17 Jun 2006 12:55:24 -0600, Keary Suska <email@hidden>
said:
>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.
I guess I'd like to know where you get that understanding. I'm not saying
you're wrong; I'm asking where to look in the docs.
>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".
Well, maybe I'm just not understanding any of this. My base case was to bind
the NSArrayController to MyObject's "thing", with no other code. When (in
the app's interface) I add a row and edit it, MyObject's "thing" goes from
being null to being an array of dictionaries, with the correct values.
On the other hand, it does this whether or not "automatically prepares
content" is checked. So I'm no closer to understanding "automatically
prepares content".
And I still don't understand why implementing accessors would cause this
behavior to break. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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