• 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
problem with floats/floatForKey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with floats/floatForKey


  • Subject: problem with floats/floatForKey
  • From: Duncan Campbell <email@hidden>
  • Date: Thu, 21 Apr 2005 16:32:31 +1000

Hey folks.

If i do the following:

NSLog(@"direct from Defaults: %f",[defaults floatForKey:@"myFloatKey"]);

I get the value I want.

However, if I do this:

float myVar = [defaults floatForKey:@"myFloatKey"];
NSLog(@"after assignment: %f",myVar);


I get a very funky value for "myVar".

What am I doing wrong here?

Cheers.

---------------------------------------------------------------
Duncan Campbell
http://www.duncanandsarah.com/duncan
---------------------------------------------------------------

 _______________________________________________
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

  • Follow-Ups:
    • Re: problem with floats/floatForKey
      • From: Magnus Strand <email@hidden>
  • Prev by Date: Newbie, How to drag from a view to editors and the finder
  • Next by Date: Re: problem with floats/floatForKey
  • Previous by thread: Re: Newbie, How to drag from a view to editors and the finder
  • Next by thread: Re: problem with floats/floatForKey
  • Index(es):
    • Date
    • Thread