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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to