• 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: Converting uint16_t port to a NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting uint16_t port to a NSString


  • Subject: Re: Converting uint16_t port to a NSString
  • From: Andrew Farmer <email@hidden>
  • Date: Tue, 5 Jun 2007 01:41:44 -0700

On 05 Jun 07, at 01:13, Alexander Hartner wrote:
I am trying to construct an NSString from a set of different component. For some reason I am having problems converting a uint16_t correctly. In my tests it should convert the value 58080 to "58080". On PPC this has worked correctly, but on intel it converts it to 57570. I figure is something I am doing wrong related to stringWithFormat. I already tried using %i, %u %hu, but they all see to produce the same result.

It has nothing to do with your formatting call - it's an endian problem. I don't know where you're getting the value from, but it's in network byte order, not host byte order. These are identical on PPC, but not on Intel.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

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


References: 
 >Converting uint16_t port to a NSString (From: Alexander Hartner <email@hidden>)

  • Prev by Date: Re: setting corner view
  • Next by Date: Re: setting corner view
  • Previous by thread: Converting uint16_t port to a NSString
  • Next by thread: Re: Converting uint16_t port to a NSString
  • Index(es):
    • Date
    • Thread