Reputation: 31
NSString *_str=@"rank";
const char *color_char1 = [_str cStringUsingEncoding:NSASCIIStringEncoding];
I run it in iphone 6.0 Simulator, it works fine; but when I run it on new iPad it crashes.
I can't get color_char1
,why?
Upvotes: 3
Views: 825
Reputation: 469
try this code.
NSString *_str=@"rank";
const char *color_char1 = (char *)_str;
Upvotes: 0
Reputation: 160
const char * myChar = [@"hey I am an NSString" UTF8String];
That should work :D
Upvotes: 2