Re: NSNumberFormatter and 10.4 behavior
Re: NSNumberFormatter and 10.4 behavior
- Subject: Re: NSNumberFormatter and 10.4 behavior
- From: Lee Ann Rucker <email@hidden>
- Date: Wed, 18 Jul 2007 13:43:31 -0700
MyNumberFormatter *numberFormatter;
numberFormatter = [[[MyNumberFormatter alloc] init] autorelease];
[myTextField setFormatter:numberFormatter];
[numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
[numberFormatter setMinimumFractionDigits:2];
[numberFormatter setMaximumFractionDigits:2];
[numberFormatter bind:@"minimum"
toObject:creatorData
withKeyPath:@"myMinValue"
options:nil];
[numberFormatter bind:@"maximum"
toObject:creatorData
withKeyPath:@"myMaxValue"
options:nil];
@implementation MyNumberFormatter
+ (void)initialize
{
[self setDefaultFormatterBehavior:NSNumberFormatterBehavior10_4];
}
- (BOOL)isPartialStringValid: (NSString *)partialString
newEditingString: (NSString **)newString
errorDescription: (NSString **)error
{
// Make sure that the NumberFormatter only allows Numbers -
something the default really ought to do...
...
}
On 17 juil. 07, at 19:12, mmalc crawford wrote:
How are you creating the formatters?
mmalc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden