Extracting double or float from an NSAppleEventDescriptor
Extracting double or float from an NSAppleEventDescriptor
- Subject: Extracting double or float from an NSAppleEventDescriptor
- From: Ken Tozier <email@hidden>
- Date: Sat, 3 Jul 2004 17:58:57 -0400
I'm sure this is an easy one, but I'm having a little trouble
extracting double and float values from NSAppleEventDescriptors.
They don't have convenience methods for either of these types and my
attempts aren't working.
Here's what I've tried:
Assume aDescriptor contains a double.
double aDouble = *(double*)[[aDescriptor data] bytes];
Is there a less squirrely way to coerce the value of an NSData object
to a float or double? NSNumber doesn't seem to have any initializers
that support them.
Thanks
Ken
_______________________________________________
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.