December 2013
Beginner
576 pages
16h 4m
English
The Foundation classes implement methods known as copy and mutableCopy that you can use to create a copy of an object. This is done by implementing a method in conformance with the <NSCopying> protocol for making copies. If your class needs to distinguish between making mutable and immutable copies of an object, you must implement a method according to the <NSMutableCopying> protocol as well. You learn how to do that later in this section.
Getting back to the copy methods for the Foundation classes, given the two NSMutableArray objects dataArray2 and dataArray, as described in the previous section, the statement
dataArray2 = [dataArray mutableCopy];
creates a new copy of dataArray ...
Read now
Unlock full access