• 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
Re: How do I store a float as a value in NSDictionary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I store a float as a value in NSDictionary?


  • Subject: Re: How do I store a float as a value in NSDictionary?
  • From: Christian Brunschen <email@hidden>
  • Date: Sun, 20 Jun 2004 13:22:26 +0100

On 20 Jun 2004, at 13:08, Koen van der Drift wrote:

Hi,

I am trying to make an NSDictionary with the following structure:

<key>@"key A"</key>
<value> myFloatA</value>
<key>@"key B"</key>
<value> myFloatB</value>

[ ... ]

I understand that setObject should actually be passed an object, not a float or int, so should I convert the float to an object, say NSNumber? Or is there another solution?

You've already found the answer yourself: you need to put the float into an NSNumber object, and store that NSNumber object in your dictionary,

thanks,

Best wishes,

- Koen.

// Christian Brunschen
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >How do I store a float as a value in NSDictionary? (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: How do I store a float as a value in NSDictionary?
  • Next by Date: Debugger calling string methods on a window
  • Previous by thread: Re: How do I store a float as a value in NSDictionary?
  • Next by thread: Re: Redirect stderr to NSTextView
  • Index(es):
    • Date
    • Thread