I have a problem with a NSMutableArray. I want to create a loop that fill an mutableArray initially empty but Xcode generates two error: "Assigning to "NSMutableArray" from incompatible type 'void'", "void value not ignored as it ought to be". This is the code:
NSMutableArray * arrayToFill =[[NSMutableArray alloc]init];
int i=0;
while (i<4){
NSDictionary * dictionary =[[NSDictionary dictionaryWithObjectsAndKeys: @"value1", @"key1",@"value2",@"key2", nil];
arrayToFill =[arrayToFill insertObject:dictionary atIndex:i];
i++;
}