I have a list of objects (trucks) with various attributes that populate the table. When you click on them, they go to a separate page of the truck. There is an add button that will add them to your favorites in another table. How to initialize an empty mutable array in Cocoa?
I have the following code:
-(IBAction)addTruckToFavorites:(id)sender:(FavoritesViewController *)controller
{
[controller.listOfTrucks addObject: ((Truck_Tracker_AppAppDelegate *)[UIApplication sharedApplication].delegate).selectedTruck];
}
source
share