• 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
CoreData: Validation errors have "%{PROPERTY}@" in the localized description?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData: Validation errors have "%{PROPERTY}@" in the localized description?


  • Subject: CoreData: Validation errors have "%{PROPERTY}@" in the localized description?
  • From: Jim Correia <email@hidden>
  • Date: Wed, 11 Apr 2007 17:35:53 -0400

I have an application that I've built from the CoreData document template.

If I have a basic validation error (i.e. nil value for an attribute which is required) CoreData uses the attribute name in the localized description of the generated error.

However, for my own validation errors, I'm seeing "%{PROPERTY}@ is not valid".

How can I correct this?

I've tried generating errors with and without userInfo dicts. Here's a sample implementation.

- (BOOL)validateName:(id *)valueRef error:(NSError **)error
{
if (error != NULL) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
[userInfo setObject: self forKey: NSValidationObjectErrorKey];
[userInfo setObject: @"name" forKey: NSValidationKeyErrorKey];
if (*valueRef != nil) {
[userInfo setObject: *valueRef forKey: NSValidationValueErrorKey];
}
*error = [NSError errorWithDomain: NSCocoaErrorDomain code: NSManagedObjectValidationError userInfo: userInfo];
}


	return NO;
}

Jim
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Re: init method of NSObjectController subclass
  • Next by Date: Problem with AESend()
  • Previous by thread: Re: init method of NSObjectController subclass
  • Next by thread: Problem with AESend()
  • Index(es):
    • Date
    • Thread