ios NSArray获取2个索引之间的所有索引

ios NSArray获取2个索引之间的所有索引,ios,objective-c,nsarray,Ios,Objective C,Nsarray,我有一个包含以下内容的数组 "Dave.", "Dave is an awesome guy", Dave Lan, "Josh.", "Josh is funny", Josh Nepy, "Zach", "Zach is too lazy", Zach Sung 我想知道每个人的名字,有什么办法吗?你可以试试这个 NSDictionary *dict1 = @{ @"name" : @"Dave",

我有一个包含以下内容的数组

"Dave.",
    "Dave is an awesome guy",
   Dave Lan,
"Josh.",
    "Josh is funny",
   Josh Nepy,
"Zach",
    "Zach is too lazy",
   Zach Sung
我想知道每个人的名字,有什么办法吗?

你可以试试这个

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"];

你能更清楚地描述一下数组结构吗;你现在的问题没有多大意义。看起来NSDictionary数组应该是一个更好的结构。如何创建阵列?