Re: Non-nil terminated C string to NSString
Re: Non-nil terminated C string to NSString
- Subject: Re: Non-nil terminated C string to NSString
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 2 Aug 2006 18:10:39 -0700
On 8/2/06, Ben Phipps <email@hidden> wrote:
I want to turn a non-nil terminated c string (such as the one
received from Keychain) into an NSString. Since
stringWithCString:length: is deprecated in 10.4, what is the correct
way to do this?
Creating an NSString then asking for a substring seems wasteful as
the initial string could be huge. And inserting a null character
into the c string doesn't work since I could be corrupting memory.
Any suggestions?
"non-nil terminated c string"? That isn't a c string. Can you better
describe the source of this "string".
Anyway review the recommendation in the docs of what you can use...
<http://gemma.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/doc/uid/20000154-stringWithCString_length_>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden