How can i convert NSdata to hex string?
问题 i tried following codes for converting a NSData to hex string values but all are wrong? here "result" is my NSdata i need a hex string as output but iam not getting that NSUInteger dataLength = [result length]; NSLog(@"%d",dataLength); NSMutableString *string = [NSMutableString stringWithCapacity:dataLength*2]; const unsigned char *dataBytes = [result bytes]; for (NSInteger idx = 0; idx < dataLength; ++idx) { [string appendFormat:@"%02x", dataBytes[idx]]; } NSLog(@"%@",string); how can i