Currency Converter sample [rateField selectText:self]; doesn't work...?
Currency Converter sample [rateField selectText:self]; doesn't work...?
- Subject: Currency Converter sample [rateField selectText:self]; doesn't work...?
- From: Lloyd Sargent <email@hidden>
- Date: Mon, 16 Jul 2001 11:08:58 -0500
On Sunday, July 15, 2001, at 05:22 PM, email@hidden
wrote:
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
Well, I'm not sure what to tell you. I seem to get a correctly working
program using the code from the Cocoa book, so I don't think it is a
"known bug". Nor do I think it is a badly written sample.
Does the program work other than just not selecting the rateField?
Anything odd happen during execution?
Cheers,
Lloyd
-----
Canna Software Development
"No animals were harmed in the creation of this email, however some
routers suffered painful bumps and bruises."
OS X Release Version - As Good As It Gets!