0

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:

  1. Loop through the array of dictionaries in the plist file.
  2. Check if iItemDayPriceId inside the dictionary is already existing.
  3. If existing, update the dictionary with iItemDayPriceId.
  4. 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!

Lie-An
  • 2,563
  • 3
  • 17
  • 20
  • 1
    Refer: http://stackoverflow.com/questions/9335475/iphone-read-write-plist-file/9338807#9338807 – Mrunal Aug 27 '13 at 07:12
  • @Mrunal, thank you for that link. I'll just change some codes to check if object is already existing. :) – Lie-An Aug 27 '13 at 09:12

0 Answers0