NSMutableArray addObjectsFromArray
- (void)addObjectsFromArray:(NSArray *)otherArray
Parameters of [NSMutableArray addObjectsFromArray]
otherArray
An array of objects to add to the end of the receiving array’s content.
NSMutableArray addObjectsFromArray example.
NSMutableArray *searchArray = [[NSMutableArray alloc] init];
for (NSDictionary *dictionary in searchedContactsFromTable)
{
NSMutableArray *array = (NSMutableArray *)[[[dictionary objectForKey:@"fullName"] miutableCopy];
[searchArray addObjectsFromArray:array];
}
for (NSDictionary *dictionary in searchedContactsFromTable)
{
NSMutableArray *array = (NSMutableArray *)[[[dictionary objectForKey:@"fullName"] miutableCopy];
[searchArray addObjectsFromArray:array];
}
Example of [NSMutableArray addObjectsFromArray].
NSMutableArray *array = [[NSMutableArray alloc] init];
NSMutableArray *searchArray = [[NSMutableArray alloc] init];
for (NSDictionary *dictionary in searchedContactsFromTable)
{
[array addObject:[dictionary objectForKey:@"fullName"]];
[searchArray addObjectsFromArray:array];
}
NSMutableArray *searchArray = [[NSMutableArray alloc] init];
for (NSDictionary *dictionary in searchedContactsFromTable)
{
[array addObject:[dictionary objectForKey:@"fullName"]];
[searchArray addObjectsFromArray:array];
}
NSMutableArray addObjectsFromArray example.
NSMutableArray *objectsToAdd= [[NSMutableArray alloc] initWithObjects:@"one",@"two", nil];
NSMutableArray *myArray = [[NSMutableArray alloc] initWithObjects:objectsToAdd,nil];
self.list = [[NSMutableArray alloc] init];
[self.list addObjectsFromArray:myArray];
NSMutableArray *myArray = [[NSMutableArray alloc] initWithObjects:objectsToAdd,nil];
self.list = [[NSMutableArray alloc] init];
[self.list addObjectsFromArray:myArray];