• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSFormatter workings question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: progressIndicator in cocoa
  • Next by Date: Re: NSSlider and mouse events
  • Previous by thread: Re: Connecting to iSeries/AS400
  • Next by thread: save to file
  • Index(es):
    • Date
    • Thread