The copy method only makes a shallow copy, i.e. a new copy of the collection itself, not all the objects storing inside. The book I am studying now suggested to use archive to create deep copy, i.e. use NSKeyedArchiver to save the collection object to an NSData object, then load it back to another collection object using NSKeyedUnarchiver. This method works, but I am not sure how efficient it is to cope with large collection objects. Is there any other deep copying method which might works better?
Alright, this is what I want to know:
- Any method which involves less coding?
- Any method which is more CPU efficient?
- Any method which can achieve both? :P