I have User and Friend objects in my data model that are one user for many relationships with friends.
My ViewController, an instance of the variable is created for the user (* user), and therefore I can access all friends by loading user.friends as friends as an NSS object in my User object.
In my code, I load all friends into NSMutableArray, do some things, and maybe before leaving I want to add additional friends and edit the attributes of existing friends. I do not understand how I can add / edit friends.
Should I edit NSMutableArray objects for friends and save them back to User.context? If so, how?
If you are editing a friend, should I copy an existing friend object, change the values, delete the old object from the array and add a new (copied and updated) one?
Hope this makes sense ...
source
share