我有一个包含以下内容的数组
"Dave.",
"Dave is an awesome guy",
Dave Lan,
"Josh.",
"Josh is funny",
Josh Nepy,
"Zach",
"Zach is too lazy",
Zach Sung
我希望得到每个人的名字,任何想法怎么做?
答案 0 :(得分:0)
你可以试试这个
NSDictionary *dict1 = @{
@"name" : @"Dave",
@"desc" : @"Dave is an awesome guy",
@"fullName" : @"Dave Lan"
};
NSDictionary *dict2 = @{
@"name" : @"Josh",
@"desc" : @"Josh is funny",
@"fullName" : @"Josh Nepy"
};
NSDictionary *dict3 = @{
@"name" : @"Zach",
@"desc" : @"Zach is too lazy",
@"fullName" : @"Zach Sung"
};
NSArray *personArray = @[dict1, dict2, dict3];
//get first person des
NSString *desc = personArray[0][@"desc"];
//get the third full name
NSString *fullName = personArray[2][@"fullName"];