Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
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