Q:

Convert dictionary items from plist to NSArray

I have a plist with the following architecture/structure:
dictionary
   key1
    item1
   key2
    item2
   key3
    item3
dictionary
   ...

and i want to load item (item1) for the first key (key1) of every dictionary to an NSArray, so that i can load the nsarray into a UITableView.
i cam to this point:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

    NSString *documentsDirectory = [paths objectAtIndex:0];

    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"data.plist"];

    NSMutableArray *array = [[NSMutableArray alloc] initWithContentsOfFile:path];

and then i wanted to add something like this:
tablearray = [array objectsForKey:@"key1"];

but that doesn't exist as command. Seems like i need some help there... :)

A:

You can loop over the Array and add the Objekts that way:
NSMutableArray *tablearray = [NSMutableArray arrayWithCapacity:[array count]];
for (NSDictionary *dict in array) {
    [tablearray addObject:[dict objectForKey:@"key1"]];
}

