1

我正在尝试从 sudzc wsdl 返回多行。我已将结果加载到字典中。下面的代码给了我第一个结果。如何检索所有结果而不仅仅是第一个结果?我正在寻找 [ID.text intValue] == CSHR_NUM 的 CSHR_POS_NAME。

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
...
4

1 回答 1

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]]; 
于 2013-11-11T14:24:58.267 回答