I have a orderedItems.plist file. I want it to have an array of dictionaries.
Here's a sample:
{
iItemDayPriceId: 72
fQty: 1
sItemName: "Tomato Juice"
fPrice: 10
sModifier: "test modifier"
}
I want to save it in a plist. Then, for example the user will order another item. I will setup the dictionary again and add it to the plist file.
So here's what I'm thinking to resolve this:
- Loop through the array of dictionaries in the plist file.
- Check if iItemDayPriceId inside the dictionary is already existing.
- If existing, update the dictionary with iItemDayPriceId.
- If not existing, add the new array of dictionary to the existing plist file.
May I know how can I do this?
Thank you so much!