Basic Objective-C class objects such as
NSData can be archived and restored in the manner just described. That includes nested objects as well, such as an array containing a string or even other array objects.
This implies that you can’t directly archive your
AddressBook that we developed in Chapter 15, using this technique because the Objective-C system doesn’t know how to archive an
AddressBook object. If you try to archive it by inserting a line such as
[NSKeyedArchiver archiveRootObject: myAddressBook toFile: @"addrbook.arch"];
into your program, you get the following message if you run the program: