Re: NSString & NSMutableData
Re: NSString & NSMutableData
- Subject: Re: NSString & NSMutableData
- From: Phil Larson <email@hidden>
- Date: Mon, 21 Apr 2003 09:12:03 -0700
It's in the docs:
<
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSString.html>
- (id)initWithData:(NSData *)data encoding:(NSStringEncoding)encoding
also, you can get to a NSMutableData by doing [NSMutableData dataWith
Data:[myString dataUsingEncoding:NSISOLatin1StringEncoding]];
Or any other encoding you want of course.
Phil
On Monday, April 21, 2003, at 08:55AM, Peter Karlsson <email@hidden> wrote:
>
Dear list!
>
>
I can put a NSString into a NSMutableData object with this code:
>
>
NSMutableData *data;
>
NSString *myString = @"Some text";
>
data = [NSMutableData dataWithBytes:[myString cString] length:[myString
>
length]];
>
>
But how do I get the NSMutableData back to the NSString object?
>
>
Peter
>
>
>
_________________________________________________________________
>
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
>
http://join.msn.com/?page=features/featuredemail
>
_______________________________________________
>
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.
_______________________________________________
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.