Hi All,
I have User and Friend entities in my data model, being a one User to many Friends relationship.
My ViewController, is instantiated with an instance variable for User (*user), and therefore I can access all friends by loading user.friends as friends is defined as an NSSet in my User object.
In my code I load all friends in an NSMutableArray, do some stuff, and potentially before leaving want to add additional friends, and edit the attributes of existing friends. I'm at a loss on how I can add/edit friends.
Should I edit the NSMutableArray of friend objects, and save that back to the User.context? If so, how?
If editing a friend, should I copy existing friend object, change values, delete old object from the array and add the new (copied and updated) one?
I hope this makes sense...