我正在尝试从sudzc wsdl返回多行。我已将结果加载到字典中。下面的代码给出了第一个结果。如何检索所有结果而不是第一个结果?我正在寻找CSHR_POS_NAME,其中[ID.text intValue] == CSHR_NUM。
dict = [resp objectForKey:@"TC"];
if( ( dict == nil ) || ![dict isKindOfClass:[NSDictionary class]] ) {
NSLog( @"WARNING: %@", [dict description]);
return;
}
desc = [[dict objectForKey:@"CSHR_POS_NAME"]copy];
CashierNum = [[dict objectForKey:@"CSHR_NUM"]copy];
NSLog(@"Name: %@ and Cashier Number: %@",desc, CashierNum);
我能够在vb中完成:
If dsCashiers.Table("TC").Rows.Count > 0 Then
...
答案 0 :(得分:0)
[d setObject:v forKey:[child name]];
NSString* key = [child name];
id check = [d objectForKey:key];
if( check != nil ) {
NSInteger next = 1;
key = [NSString stringWithFormat:@"%@%d", [child name], next];
check = [d objectForKey:key];
while( check != nil ) {
next++;
key = [NSString stringWithFormat:@"%@%d", [child name], next];
check = [d objectForKey:key];
}
[d setObject:v forKey:key];
}
[d setObject:v forKey:[child name]];