1

I have one scenario here, and maybe someone could enlighten me at this corner stone. I have a singleton where initially my json is getting parsed, and I am loading the contents from there to my Data Model.

Now lets say I deep copy from singleton to my data model, is there anyway to transverse the information back to the singleton when information changes in my data model? At current I am doing some brute forcing to update my data model and singleton objects to keep consistency, but I simple think this is a bad approach.

There would be some better way to reverse deep copy somehow, but just trying to see my options here.

Thanks

topgun
  • 2,463
  • 8
  • 31
  • 46

1 Answers1

1

You should probably look into KVO, i.e. the mechanism that enables bindings or CoreData.

Definitely check the Apple docs - but for a quick starter have a look at Observing an NSMutableArray for insertion/removal

Community
  • 1
  • 1
Jay
  • 6,572
  • 3
  • 37
  • 65
  • Thanks @Jay. Currently I have two NSMutableArray's one with All contents, and one with All contents - x. I want to determine what is x here and set some value in nsmutablearray of each x. Do you think there is a way to compare two NSMutableArray and set the value of something that doesn't matches somehow? Thanks – topgun Dec 16 '11 at 20:32