• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Error validating email addresses in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error validating email addresses in Core Data


  • Subject: Error validating email addresses in Core Data
  • From: Michael Crawford <email@hidden>
  • Date: Fri, 15 Apr 2011 09:30:39 -0400

I'm trying to validate email addresses in Core Data but the regular expression I'm using doesn't seem to work even though it looks correct.  I'm using the following expression:

^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$

Which produces the following error:

NSValidationErrorKey=email, NSLocalizedDescription=The operation couldn’t be completed. (Cocoa error 1680.), NSValidationErrorPredicate=SELF MATCHES "^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$", NSValidationErrorValue=email@hidden

I'm pretty certain the expression is correct so I'm thinking there must be something I don't know about how to use it with Core Data.  I'm inputing the expression in the MOM editor in Xcode 4, not coding to the APIs directly.  In my code I'm calling -[NSManagedObject validateForInsert].

If you've run into problems using regular expressions with Core Data and then found a solution or if you see some obvious problem with what I have here, I'd love to here from you.

-Michael

_______________________________________________

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

  • Follow-Ups:
    • Re: Error validating email addresses in Core Data
      • From: Dave Carrigan <email@hidden>
    • Re: Error validating email addresses in Core Data
      • From: Kyle Sluder <email@hidden>
    • Re: Error validating email addresses in Core Data
      • From: Conrad Shultz <email@hidden>
    • Re: Error validating email addresses in Core Data
      • From: Dave DeLong <email@hidden>
  • Prev by Date: Re: Localized.strings is being ignored
  • Next by Date: Re: renaming directories and moving files into them (NSFileManager)
  • Previous by thread: Looking to brush up on XCode from the desktop (a.k.a. non-iOS) perspective.
  • Next by thread: Re: Error validating email addresses in Core Data
  • Index(es):
    • Date
    • Thread