Open vivekReddyBlackBuck opened 7 years ago
Sorry, I don't understand what exactly you can't copy?
How do I create a copy of APContact object? If I assign Apcontact object to some variable , then I have a reference but I want a copy so that I can modify one of them and have 2 objects
I think we need to implement copywithzone method , which is not there currently or is there any other method to make a copy and assign it to another variable
Sorry, for delay.
1) Most of APAddressBook
users expect that copy
doesn't create so called 'deep copy'. But you can create the category for APContact
class with your own copy
/copyWithZone:
method implementation and use it in your project.
2) You can create something like ContactsTableViewModel
class that will store copies of APContact
fields in format (for phones numbers?) that you exactly need. I think it's a best approach to avoid mutating original object
user has 3 phone numbers , want to show them as rows in a table , if would be able to copy the APPerson contact , then it would be easy