Core Data Fetch in Different Context
Core Data Fetch in Different Context
- Subject: Core Data Fetch in Different Context
- From: Des Cullen <email@hidden>
- Date: Tue, 18 Nov 2008 11:19:35 +0000
Hi,
I am trying to prevent duplicates being created in a core data app
and am using a fetch to search for duplicates but excluding the
managedObject itself. I am using the following predicate;
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(descript
= %@) AND (self != %@)", *ioValue, [self objectID]];
This works fine if I use the same context that I loaded the data with
but if I use a new context associated with the same model and
persistent store it does not. It always returns the originating object
as well. The self filter does not seem to work in a new context. I
am using a different context since mainly as a look-up context to
avoid polluting the main context with look-up data.
What am I missing?
Regards
Des Cullen.
_______________________________________________
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