I have one array that is pre-filled with dictionaries with each dictionary consisting of two keys.
{
name = object1;
quantity = 5;
},
{
name = object2;
quantity = 2;
}
I want to be able to add more objects and combine any duplicate dictionaries. So for example, if I added 5 of object one and 3 of object 2, this would be the result.
{
name = object1;
quantity = 10;
},
{
name = object2;
quantity = 5;
}
My ultimate goal is to be able to display the quantity next to the item in a table view. What is the best way to accomplish this?