Atm*_*tma 0 xml types objective-c
在目标c中,xmlchar数据类型如何工作?我似乎无法找到任何API文档.具体来说,我的声明如下:
const xmlChar **attributes
Run Code Online (Sandbox Code Playgroud)
我是通过说它是一个客观的c数据类型还是特定于cocoa或只是C来正确地对此进行分类?
您可以在libxml2库xmlChar中xmlString.h找到声明:
Run Code Online (Sandbox Code Playgroud)typedef unsigned char xmlChar;
现在进行xmlChar to NSString转换
xmlChar *str = (unsigned char *)"I am to be converted";
NSString *convertedString = [NSString stringWithUTF8String:(const char *)str];
Run Code Online (Sandbox Code Playgroud)
从NSString to xmlChar转换;
NSString *str = @"I am to be converted";
xmlChar *convertedString = (xmlChar *)[str UTF8String];
Run Code Online (Sandbox Code Playgroud)