I created a model in Xcode, and for various attributes I have defined minimum and maximum values ββand which are executed by coreData at runtime.
I am using NSManagedObject validateValue: forKey: error to validate user input values.
I was a little disappointed to see that the localized error message is not specific, and I get "Operation could not be completed. (Cocoa error 1620)" for values ββtoo small and "Cannon operation (Cocoa error 1610)" for values ββtoo large .
The coreData documentation says that "you can localize most aspects of the managed object model, including object and property names and error messages." Unfortunately, it does not describe in very detail how you implement it for error messages.
So how do you configure the error message? How do you localize them? Is it possible to configure it to mention the ex reference value: "The value must be lower than% @" or "The value must be higher than% @"?
source
share