• 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: Obtaining a value from a hex representation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obtaining a value from a hex representation


  • Subject: Re: Obtaining a value from a hex representation
  • From: Carl Hoefs <email@hidden>
  • Date: Fri, 08 Jan 2016 15:36:28 -0700

On Jan 8, 2016, at 3:16 PM, Steve Mills <email@hidden> wrote:
>
> Either use NSScanner or strtol if you have char* (or strtoll if it's longer than 8 hex chars).
> Sent from iCloud's ridiculous UI, so, sorry about the formatting
>
Hadn't thought to use NSScanner, though it appears a bit overkill.

strtoll() works fine. (Note: Hex values greater than 7FFFFFFF require the use of strtoll(). strtol() returns -1 in such cases.)

Guess I'll create a NSString category so I can have a -hexValue method after all.

Thanks Steve, Quincey, Jens!
-Carl


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Strange UIAlertController / UICollectionViewFlowLayout issue
      • From: email@hidden
References: 
 >Re: Obtaining a value from a hex representation (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Obtaining a value from a hex representation
  • Next by Date: Any way to Rename a File that is being Dragged before it's Dropped?
  • Previous by thread: Re: Obtaining a value from a hex representation
  • Next by thread: Strange UIAlertController / UICollectionViewFlowLayout issue
  • Index(es):
    • Date
    • Thread