I'm using a NSNumberFormatters in a modal dialog to validate text fields. I want to give the user a specific and appropriate error message if they try to OK the dialog with an invalid number in a field. For example I want different error messages for "no string entered", "non numeric string entered", "value larger than max", "value less than min".

In my implementation of control:didFailToFormatString:errorDescription: I get notified that a format failed, but the description is always "Formatting error". I tried calling getObjectValue:forString:range:error: on the formatter, but as far as I can tell the NSError returned is the same for each error condition.

So.. I could check the passed in string myself, for length, validity, then max/min, and generate my error message accordingly, but then I'm reimplementing the validation?

Is there a better way to achieve this?

thanks
Rua HM.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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