NSArrayController selects inserted NSManagedObject with delay
NSArrayController selects inserted NSManagedObject with delay
- Subject: NSArrayController selects inserted NSManagedObject with delay
- From: Camille GOUREAU-SUIGNARD <email@hidden>
- Date: Sun, 14 Jan 2007 11:25:31 +0100
Hi,
I've got a slight problem that I'm tired to bypass.
I often use the insert: method on an arrayController (whose mode is
entity, and is set to select inserted objects).
Immediatly after the managedObject has been inserted, I need to alter
it (it comes from several places with several different intents, so
it can't be managed in awakeFromInsert).
So I try to get a handle on it by using:
[[theArrayController selectedObjects] objectAtIndex: 0]
The problem is that it seems to be a slight delay between the time
when I issue the insert: method and the time the new object is
selected. So, when, immediatly after the insert, I try to recover the
object, there is no selection in my arrayController.
Eache time I have this problem I bypass it by creating a method for
the recovering and altering of the object, and call that method after
the insertion by a performSelector: withObject: afterDelay.
But it's quite heavy, and I'm quite sure cocoa should be neater than
that. I should be missing something.
Could somebody be kind enough to point me where I should look at ?
Many thanks.
Camille GOUREAU
Et mon blog: www.lutin-ludique.com/bradype/
_______________________________________________
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