I guess it would be a duplicate, In metaData I am getting “Live365” Stream metadata, but still I am asking I am getting null if I am using
NSLog(@"SONG META :%@", [[NSString alloc]
initWithData:metaData encoding:NSUTF8StringEncoding]);
and it’s printing ASCII values if I am using
NSLog(@"SONG META :%@", [[NSString alloc]
initWithData:metaData encoding:NSASCIIStringEncoding]);
I have tried below schemes but getting null:
NSUTF8StringEncoding
NSUTF16BigEndianStringEncoding
NSUTF16LittleEndianStringEncoding
NSUTF32BigEndianStringEncoding
NSUTF32StringEncoding
You have to make sure your
NSMutableDataobject is indeed complete. If you download it from a web service you should only alloc-init the string after the download has finished.If it is a valid string, your method should work fine.
If not, it is not a valid string and the results is expected.