如何使用objective-c

时间:2017-09-22 04:21:33

标签: objective-c

我正在开发适用于儿童应用的应用。

NSDictionary *data = @{@"A":@[@"Apple",@"Ant",.....],
                       @"B":@[@"Ball",@"Bat",.....],
                       @"C":@[@"Call",@"Cat",.....],
                       .
                       .
                       .
                       };

如何获取数据apple和ant

1 个答案:

答案 0 :(得分:0)

NSArray *dataFromA = data[@"A"];
//Apple and Ant
NSString *apple = dataFromA[0];
NSString *ant = dataFromA[1];
//or
NSString *apple = data[@"A"][0];
NSString *ant = data[@"A"][1];