An NSMutableArraycan usually be built by simply adding objects to the end. methodaddObject:
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"another_value", @"another_key", nil];
NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:dictionary];
On the other hand, if you want to access the dictionary using the key (@ "some_key"), you will also need an external container for the dictionary:
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"another_value", @"another_key", nil];
NSMutableDictionary *outerDict = [NSMutableDictionary dictionary];
[outerDict setObject:dictionary forKey:@"some_key"];
source
share