Core Data: is fetching safe during validateForInsert:/validateForUpdate?
Core Data: is fetching safe during validateForInsert:/validateForUpdate?
- Subject: Core Data: is fetching safe during validateForInsert:/validateForUpdate?
- From: "Sean McBride" <email@hidden>
- Date: Mon, 23 Mar 2009 16:54:41 -0400
- Organization: Rogue Research Inc.
Hi all,
Is it OK to perform a fetch during validateForInsert:/
validateForUpdate:? I have a Core Data entity named 'Person' with an
attribute named 'uniqueNumber'. I want to ensure that no two People
have the same uniqueNumber.
I have implemented validateForInsert:/validateForUpdate: along these lines:
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdValidation.html#//apple_ref/doc/uid/TP40004807-SW3>
and perform a fetch to see if there are duplicate uniqueNumbers. It
seems to be working. But I know fetching is problematic elsewhere, so
thought I'd check.
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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