开发者

Converting an NSString* to char?

开发者 https://www.devze.com 2023-01-02 12:09 出处:网络
How can I convert a NSString* into a char? EDIT: Thanks to Vladimir for getting me t开发者_运维技巧here!

How can I convert a NSString* into a char?

EDIT: Thanks to Vladimir for getting me t开发者_运维技巧here!

NSString *myString = @"HelloWorld";
const char *stringAsChar = [myString cStringUsingEncoding:[NSString defaultCStringEncoding]];

Hope this helps someone in the future!


Simple to transfer

const char *cfilename=[stringobject UTF8String];
0

精彩评论

暂无评论...
验证码 换一张
取 消