> Using control:didFailToFormatString:errorDescription: and always
> returning YES will stop the "Formatting Error" sheet.


Is this the only way to stop that "formatting error" sheet? I tried it and it 
sure works. A major drawback, however, is that editing ends even if it was 
invalid.

And that means I have to implement the control:textShouldEndEditing: method and 
return NO from there if the state is invalid and YES otherwise. If I combine 
this with the previous method (control:didFailToFormatString:errorDescription:) 
returning YES, it seems to be working.


But even if it works, it is giving me some headaches because it seems like such 
a weird solution to get rid of a simple sheet. Why do I think it's weird? 
Because in the second method (control:didFailToFormatString:errorDescription:) 
I'm effectively doing all those validation checks all over again. Seems like a 
strange hack to me.



> A custom NSNumberFormatter subclass can be used to block characters
> that are not in decimalDigitCharacterSet and sound a beep. Read the
> last paragraph of:


Thanks for suggesting this. It seems to be working beautifully.



_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx_______________________________________________

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 arch...@mail-archive.com

Reply via email to