NSString <-> NSData 형변환
NSString to NSData
NSString* str = @"test String"; NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding];
NSData to NSString
NSString *str = [NSString stringWithUTF8String:[data bytes]]; NSString *str = [NSString stringWithFormat:@"%.*s", [data length], [data bytes]];