i have this string
NSString * str = @ "01 00 00 41 8B 00 01 00 00 40 BC 00 01 00 00 43 0D 00";
and i try convert it to NSacii with this finction
- (NSString *)hexToString:(NSString *)string {
NSMutableString * newString = [[NSMutableString alloc] init];
NSScanner *scanner = [[NSScanner alloc] initWithString:string];
unsigned value;
while([scanner scanHexInt:&value]) {
[newString appendFormat:@"%c",(char)(value & 0xFF)];
}
string = [newString copy];
[newString release];
return [string autorelease];
}
it work perfect , but the problem when i want to convert the string to hex i cant find the 00 it mean the result are 01 41 8B 01 40 BC 01 43 0D