我正在尝试在 iPhone 应用程序中读取和解析 xml 文档。我开始解析,然后使用覆盖方法:
static void startElementSAX(void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI,
int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes)
然后我尝试将属性转换为字符串:
NSString *str1 = [[NSString alloc] initWithCString:attributes encoding:NSUTF8StringEncoding];
为什么attributes参数前面有两个**。以及为什么在尝试使用上述代码提取数据并将其转换为字符串时会收到警告:
从不兼容的指针类型传递 'initWithCString:encoding:' 的参数 1。