 |
|
 |
 |
 |
 |
|
 |
 |
 |
 |
 |
Lorenzo Thurman Guest
 |
Posted: Tue Jul 03, 2007 4:12 pm Post subject: NSNumberFormatter Q |
 |
|
| I'm using a couple of formatters in my app setup via IB to keep values within a range. This works, and when an out of range value is entered, I get the dialog box explaining the error. How do I override the default and provide my own? I've gone through the docs for NSNumberFormatter, but can't figure it out. Can someone give me a pointer? TIA |
|
| |
|
|
|
 |
 |
 |
 |
 |
Nick Tamburri Guest
 |
Posted: Thu Jul 05, 2007 7:58 pm Post subject: Re: NSNumberFormatter Q |
 |
|
Lorenzo Thurman <lorenzo@diespammerhethurmans.com> writes:
| Quote: |
| I'm using a couple of formatters in my app setup via IB to keep values within a range. This works, and when an out of range value is entered, I get the dialog box explaining the error. How do I override the default and provide my own? I've gone through the docs for NSNumberFormatter, but can't figure it out. Can someone give me a pointer? |
I believe you want to look at the delegate methods of NSControl.
For your purpose you have to set a delegate for the controller that the NSNumberFormatter is attached to. That delegate must implement the method control:didFailToValidatePartialString:errorDescription:
Hope that helps.
/nt |
|
| |
|
|
|
 |
 |
 |
 |
 |
Lorenzo Thurman Guest
 |
Posted: Thu Jul 05, 2007 11:11 pm Post subject: Re: NSNumberFormatter Q |
 |
|
Nick Tamburri wrote:
| Quote: |
Lorenzo Thurman <lorenzo@diespammerhethurmans.com> writes:
| Quote: |
| I'm using a couple of formatters in my app setup via IB to keep values within a range. This works, and when an out of range value is entered, I get the dialog box explaining the error. How do I override the default and provide my own? I've gone through the docs for NSNumberFormatter, but can't figure it out. Can someone give me a pointer? |
I believe you want to look at the delegate methods of NSControl.
For your purpose you have to set a delegate for the controller that the NSNumberFormatter is attached to. That delegate must implement the method control:didFailToValidatePartialString:errorDescription:
Hope that helps.
/nt |
Thanks for the reply. I'm going over the Data Formatting docs again and things are getting clearer the second time through. |
|
| |
|
|
|
 |
 |
 |
 |
 |
|
 |
 |
 |
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|