• 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
stringWithCString:length deprecation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stringWithCString:length deprecation


  • Subject: stringWithCString:length deprecation
  • From: Torsten Curdt <email@hidden>
  • Date: Wed, 7 Oct 2009 14:00:02 +0200

Hey folks,

I am in the middle of cleaning up code and moving it to 10.5+ 64bit.
For most things it's quite straight forward, but one of the
deprecations to get rid of is:

 stringWithCString:length

 cString must not be NULL. cString should contain characters in the
default C-string encoding. This method converts length * sizeof(char)
bytes from cString and doesn’t stop short at a NULL character.

The docs say one should use instead

 stringWithCString:encoding

 A C array of bytes. The array must end with a NULL character;
intermediate NULL characters are not allowed.

But that doesn't look like a real replacement. Shouldn't there be a

 stringWithCString:length:encoding

What am I missing?

Pointers? Comments? Suggestions?

cheers
--
Torsten
_______________________________________________

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:
    • Re: stringWithCString:length deprecation
      • From: Scott Thompson <email@hidden>
    • Re: stringWithCString:length deprecation
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: I think there's a problem in the documentation for NSComboBox
  • Next by Date: Re: stringWithCString:length deprecation
  • Previous by thread: Migrating screensaver to 10.6 (Snow Leopard) produces erratic behavior
  • Next by thread: Re: stringWithCString:length deprecation
  • Index(es):
    • Date
    • Thread