Re: How do I store a float as a value in NSDictionary?
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.