RE: Creating a managed object without adding it to the context?
RE: Creating a managed object without adding it to the context?
- Subject: RE: Creating a managed object without adding it to the context?
- From: Ulai Beekam <email@hidden>
- Date: Mon, 26 Jan 2009 12:21:28 +0000
- Importance: Normal
>> My problem is that when I add directly to the managed object
>> context, the item is not getting selected automatically in the array
>> controller (by the way, I see the selection visually by means of the
>> table view bound to the array controller) even if I have checked the
>> "select on insert" checkbox on the array controller in Interface
>> Builder.
>
> IIRC that happens when you insert the object directly into the managed
> object context without going through the array controller.
>
> I.e. by using NSManagedObject's
>
> -initWithEntity:insertIntoManagedObjectContext:
>
> instead of NSArrayController's
>
> -addObject:
This is actually what I'm most interested about, and the reason why I asked my question in the first place. Can someone else here confirm this? Let me repeat what is to be confirmed: When a new managed object is added to the managed object context (NB: Directly going through to the context and NOT using arrayController's add: methods), is it true that the arrayController will not select that particular object?
If this is true, it seems strange to me, as this new object will get propagated to the arrayController and hence the arrayController should detect that it is a newly added object and therefore select it automatically, right?
Remember that throughout this discussion we assume that the "select on insert" checkbox is checked for the arrayController.
_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/_______________________________________________
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