Re: NSArrayController Update Delay
Re: NSArrayController Update Delay
- Subject: Re: NSArrayController Update Delay
- From: Mike Abdullah <email@hidden>
- Date: Thu, 13 Oct 2011 23:55:30 +0100
On 13 Oct 2011, at 21:20, Richard Somers wrote:
> Consider a NSArrayController in entity mode. When a managed object is inserted into the managed object context the controller's arrangedObjects property is not updated immediately.
>
> Calling a controller 'fetch:' immediately after inserting the managed object into the managed object context does not help. The controller's arrangedObjects property is still not updated.
>
> Perhaps there is a KVO change notification delay between the time when the managed object is inserted into the managed object context and the time when the controller finds out about the change.
>
> Does anyone have any insight into what is going or how to force the NSArrayController's arrangedObjects property to update?
I'm pretty sure the array controller is observing NSManagedObjectContextObjectsDidChangeNotification to arrange its objects. Normally, this doesn't fire until the end of the runloop. But you can force it to by calling -[NSManagedObjectContext processPendingChanges]
_______________________________________________
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