On Mon, Apr 27, 2009 at 19:05, Quincey Morris
<quinceymor...@earthlink.net>wrote:

> On Apr 27, 2009, at 08:10, Martijn van Exel wrote:
>
>                currentNode.lat = (double)[attributeDict objectForKey:key];
>> ...
>> Member 'lat' is a double. The above does not work. 'Pointer value used
>> where
>> float was expected'. So I should dereference?
>>
>>               currentNode.lat = (double *)[attributeDict
>> objectForKey:key];
>>
>
> "Dereference" is the wrong word. What you actually did was *cast*, but that
> was the wrong thing to do anyway.
>
> The result of [attributeDict objectForKey:key] is always an object pointer
> (id, NSString*, NSNumber*, etc), never a scalar (int, double, etc). There
> are three possibilities here:
>

[...]

Quincey,

Thanks for the help. The 'doubleValue' is what I was looking for.
Unrelated: one of the XML attributes that needed parsing was a ISO8601 style
date string, for which neither NSDate nor NSDateFormatter curiously does not
seem to provide a parser. Some looking around provided
http://boredzo.org/iso8601parser/ which seems to do the job, but I have to
read up on the ISO8601 date format to tell whether the time zone is handled
correctly.
Thanks again.

Martijn
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to