APAddressBook
APAddressBook copied to clipboard
APContact should be copy-able
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
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.
- Most of
APAddressBook
users expect thatcopy
doesn't create so called 'deep copy'. But you can create the category forAPContact
class with your owncopy
/copyWithZone:
method implementation and use it in your project. - You can create something like
ContactsTableViewModel
class that will store copies ofAPContact
fields in format (for phones numbers?) that you exactly need. I think it's a best approach to avoid mutating original object