Re: NSArrayController selects inserted NSManagedObject with delay
Re: NSArrayController selects inserted NSManagedObject with delay
- Subject: Re: NSArrayController selects inserted NSManagedObject with delay
- From: Chris Hanson <email@hidden>
- Date: Sun, 14 Jan 2007 05:30:49 -0800
On Jan 14, 2007, at 2:25 AM, Camille GOUREAU-SUIGNARD wrote:
I often use the insert: method on an arrayController (whose mode is
entity, and is set to select inserted objects).
In what situations are you using -[NSArrayController insert:] to
create a managed object from within code? Generally, you should only
use this as a user interface action; it's declared as an IBAction, and
methods that are declared as IBAction are generally intended to manage
the whole response to the user themselves; part of this, as you've
seen, is that they may need to delay certain things for programmatic
purposes even though there will be no perceptible delay to the user.
To create a managed object in your code, use -[NSEntityDescription
insertNewObjectForEntityForName: inManagedObjectContext:] instead.
This will return the managed object, after invoking its -
awakeFromInsert, and you can do further things to it before returning
to the user.
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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