How to convert HEX to NSString in Objective-C?

后端 未结 5 1579
终归单人心
终归单人心 2020-11-27 22:06

I have a NSString with hex string like \"68656C6C6F\" which means \"hello\".

Now I want to convert the hex string into another NSString object which shows \"hello\"

5条回答
  •  眼角桃花
    2020-11-27 22:28

    +(NSString*)intToHexString:(NSInteger)value
    {
    return [[NSString alloc] initWithFormat:@"%lX", value];
    }
    

提交回复
热议问题