Re: "Live" NSFetchRequest?
Re: "Live" NSFetchRequest?
- Subject: Re: "Live" NSFetchRequest?
- From: Chris Hanson <email@hidden>
- Date: Fri, 23 Sep 2016 23:59:02 -0700
Are you asking about an NSFetchRequest that notices when objects are added to or changed in your persistent store by another process, or by another thread in the same process?
In the latter case you can use the notifications posted by the NSManagedObjectContext that's being saved, and use that to refresh the objects in the context you're using for your human interface.
Multi-process coordination is a much harder problem.
-- Chris
> On Sep 17, 2016, at 2:37 PM, Frank D. Engel, Jr. <email@hidden> wrote:
>
> Before I go reinventing the wheel to try to code around this...
>
> Is there any way I can set up a "live" NSFetchRequest in a Core Data model, so that is matches against the predicate change (for example, predicate filters on a field, the value of that field changes such that an object suddenly matches that did not before, or no longer matches when it previously did), I can get some sort of notification of the change - or even that there /was/ a change?
>
>
> Notes:
>
> * The predicate is being created by the user using an NSPredicateEditor and I am allowing a large selection of fields.
>
> * The data set could grow to include several thousand objects (maybe tens/hundreds of thousands in some cases)
>
> * I am using the result set in "real time" in some cases and need to know almost immediately when a change takes place - not a good thing to be rerunning the query multiple times per second if I don't know that a change happened - and changes to some of the attributes could be happening multiple times per second in some cases.
>
> * Some of the attributes are calculated from other attributes, but I am updating them in such a way that bindings fire.
>
> * MacOS X, not iDevices
>
>
> _______________________________________________
>
> 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
_______________________________________________
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