I have a nsdata with bytes :0017c572 528e now i need to encode this byte using either UTF 8 of Ascii For this i have used following code in Objective C
NSString *Str = [[NSString alloc] initWithData:value encoding:NSUTF8StringEncoding];
then later on at some point i need to get back the same bytes from Str for this i have used
NSData *aData = [Str dataUsingEncoding:NSUTF8StringEncoding];
NSLog(@"aData:%@", aData);
Now the problem is content of aData is null not 0017c572 528e . how can i do the this operation.
this concept works perfectly if data byte is : 323332
str = 232
aData = 323332