• 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
Extracting double or float from an NSAppleEventDescriptor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Extracting double or float from an NSAppleEventDescriptor
      • From: Ken Ferry <email@hidden>
  • Prev by Date: Re: Releasing memory
  • Next by Date: Re: Extracting double or float from an NSAppleEventDescriptor
  • Previous by thread: Re: ATSUI, AAT and OpenType
  • Next by thread: Re: Extracting double or float from an NSAppleEventDescriptor
  • Index(es):
    • Date
    • Thread