• 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
Currency Converter sample [rateField selectText:self]; doesn't work...?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Currency Converter sample [rateField selectText:self]; doesn't work...?


  • Subject: Currency Converter sample [rateField selectText:self]; doesn't work...?
  • From: tyler <email@hidden>
  • Date: Sun, 15 Jul 2001 13:31:39 -0700

Hey,
Learning Cocoa book (1st ed), page 122 in the code for the method convert:


-(IBAction)convert:(id)sender
{
float rate, amt, total;

amt = [dollarField floatValue];
rate = [rateField floatValue];

total = [converter convertAmount:amt atRate:rate];

[totalField setFloatValue:total];
[rateField selectText:self]; // THIS LINE DOESN'T SEEM TO WORK
}


The last line doesn't seem to work: [rateField selectText:self];

I do not see the rate field get selected. Is this a "Known Bug" in NSTextField (or some such)? Or a badly written sample? What is the proper way to change the active text field in the UI if this isn't it?

Thanks in advance,
tyler


  • Follow-Ups:
    • Re: Currency Converter - NSTextField selectText: Works Sometimes! Bug?
      • From: tyler <email@hidden>
  • Prev by Date: Re: Disabling some compiler warnings
  • Next by Date: Bug in NSFormatter
  • Previous by thread: Re: Disabling some compiler warnings
  • Next by thread: Re: Currency Converter - NSTextField selectText: Works Sometimes! Bug?
  • Index(es):
    • Date
    • Thread