我正在尝试使用 sudzc 生成的文件获取特定数据。我已经使用他们的示例代码来了解 cxmlnode* result = (cxmlnode*)value;
它给了我 nslog 的:.....
"描述" = "测试描述";
...
如何获取数据测试描述以放入变量中?
有谁知道它是否必须用json解析?格式不是 xml。我是新手,仍然有问题。
我通过使用 NSDictionary 弄清楚了:
if( [value isKindOfClass:[NSError class]] || [value isKindOfClass:[SoapFault class]] ) {
NSLog(@"%@", [value description]);
return;
}
// Verify we're a dictionary
if( ![value isKindOfClass:[NSDictionary class]] ) {
NSLog(@"ERROR: Response not a dictionary");
return;
}
NSDictionary* dict = (NSDictionary*)value;
NSDictionary* resp = [dict objectForKey:@"UpdateQOHLookupItemResult"];
if( ( resp == nil ) || ![resp isKindOfClass:[NSDictionary class]] ) {
NSLog(@"ERROR: UpdateQOHLookupItemResult not a dictionary");
return;
}
dict = [resp objectForKey:@"firstTierKey"];
if( ( dict == nil ) || ![dict isKindOfClass:[NSDictionary class]] ) {
NSLog(@"ERROR: Diffgram not a dictionary");
return;
}
resp = [dict objectForKey:@"secondTierKey"];
if( ( resp == nil ) || ![resp isKindOfClass:[NSDictionary class]] ) {
NSLog(@"ERROR: NewDataSet not a dictionary");
return;
}