Reputation: 4732
I have an NSArray that looks like this:
![enter image description here][1]
I need to create an NSArray that has the first URL from each of the 4 dictionaries in the array I posted. Then I will set these as a cell's text info with objectAtIndex:indexPath.row
Upvotes: 0
Views: 974
Reputation:
Isn't it an array of arrays of arrays ? Run a simple loop to do it :
NSMutableArray *urls = [NSMutableArray array];
for(NSArray *a in theArray) {
NSArray *nestedArray = [a objectAtIndex:0];
// if you need the whole string
//[urls addObject:[nestedArray objectAtIndex:0]];
// if you just need the first part of the URL
NSArray *components = [[nestedArray objectAtIndex:0]
componentsSeparatedByString:@"?"];
[urls addObject:[components objectAtIndex:0]];
}
// you got them
Upvotes: 4