December 2012
Beginner
552 pages
12h 58m
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 strategies work fine for your own classes. If those classes ...
Read now
Unlock full access