Suppose you initialize the objects and assign values the following way:
TruckLocation *truckLocationOne = [[TruckLocation alloc]initWithAnnotation:annotation
reuseIdentifier:annotationIdentifier];
truckLocationOne.name = @"name";
TruckLocation *truckLocationTwo = [[TruckLocation alloc]initWithAnnotation:annotation
reuseIdentifier:annotationIdentifier];
truckLocationTwo.name = @"name";
These objects would be added to the array temp in the following way:
1)
NSMutableArray temp = [[NSMtableArray alloc]initWithObjects:truckLocationOne,truckLocationTwo,nil];
2)
NSMutableArray temp = [[NSMtableArray alloc]init];
[temp addObject:truckLocationOne];
[temp addObject:truckLocationTwo];
Hope this answers your query