Doarchive

console에 데이터 안 잘리게 로그 남기기 ( bytes data NSString 으로 남기기 ) 본문

Mobile/iOS

console에 데이터 안 잘리게 로그 남기기 ( bytes data NSString 으로 남기기 )

오순발닦개 2020. 6. 24. 13:23

NSMutableString 을 사용할것 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
NSMutableString *wholeRawDate = [[NSMutableString alloc]init];
 
        unsigned char *bytePtr = (unsigned char *)[data bytes];
 
        for(int i=0; i<data.length; i++ )
 
        {
 
            [wholeRawDate appendFormat:@"%@", [NSString stringWithFormat:@"%02x",(Byte)bytePtr[i]]];
 
        }
 
  
        NSLog(@"wholeRawDate [%@]\n",wholeRawDate);
cs

 

728x90