tags:

views:

1166

answers:

2

NSString *test=@"ABCDEFGHIJKLMNOPQRSTUVWXYZ";

how to convsert this string to bytesarray...

pls response me..

thanks and regards

+2  A: 
NSData *bytes = [test dataUsingEncoding:NSUTF8StringEncoding];
Chuck
let me explain what is the NSData ?and what is the NSString.. how it differ from string(in java) ?
Raju
Thank you very much for helping ..by raju
Raju
+1  A: 

Depends what kind of bytes you want, but see getBytes, cStringUsingEncoding, and UTF8String.

Matthew Flaschen