NSString *color = @"0xff3322";
int num = 0;
const char * str = [color cStringUsingEncoding:NSUTF8StringEncoding];
sscanf(str, "%x", &num);
NSLog(@"%d", num);
//num中保存的就是转化完成的int类型数据
NSString *color = @"0xff3322";
int num = 0;
const char * str = [color cStringUsingEncoding:NSUTF8StringEncoding];
sscanf(str, "%x", &num);
NSLog(@"%d", num);
//num中保存的就是转化完成的int类型数据