I got some weird issue here. The code is as below
NSMutableString *unicodeString = [NSMutableString string];
for (NSUInteger i = 0; i < [data length]; i++) {
unsigned char byte;
[data getBytes:&byte range:NSMakeRange(i, 1)];
unichar unicodeChar = byte;
NSString *appendString = [NSString stringWithFormat:@"%C",[_toUnicode unicharFromCIDString:unicodeChar]];
[unicodeString appendFormat:@"%@",appendString];
NSLog(@"%@",appendString); //1
}
NSLog(@"%@",unicodeString)//2
the appendString print, but unicodeString never print. Is this because of bytes issue?? I have tried retain appendString but it still won't print
*UPDATED found the answer