NSFormatter workings question
NSFormatter workings question
- Subject: NSFormatter workings question
- From: david kiers <email@hidden>
- Date: Thu, 3 Mar 2005 18:49:11 +0100
I have a NSFormatter test subclass connected to a NSTextfield’s formatter outlet.
These are the implementations of the formatter methods:
- (NSString *)stringForObjectValue:(id)obj
{
return [NSString stringWithFormat: @"returnedStrng:%@",obj];
}
- (id *)obj
forString:(NSString *)string
errorDescription:(NSString **)errorString
{
*obj = [NSString stringWithString:string];
return YES;
}
I have the folowing questions:
-why is the stringForObjectValue: method called twice at startup? The textField is initial responder without placeholder...
- why is the getObject:forString method called three times and then the stringForObjectValue: two times after ending the textField edit. Setting the textField’s content programatically with
[textField setStringValue:@"some text"]; causes these two methods to be called only once.
Thanks,
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden