December 2013
Beginner
576 pages
16h 4m
English
If you try to use the copy method on one of your own classes (for example, on your address book) as follows
newBook = [myBook mutableCopy];
you’ll get an error message that looks something like this:
*** -[AddressBook copyWithZone:]: selector not recognized*** Uncaught exception:*** -[AddressBook copyWithZone:]: selector not recognized
As noted, to implement copying with your own classes, you have to implement one or two methods according to the <NSCopying> protocol.
We now show how you can add a copy method to your Fraction class, which you used extensively in Part I, “The Objective-C Language.” Note that the techniques we describe here for copying ...
Read now
Unlock full access