December 2013
Beginner
576 pages
16h 4m
English
Basic Objective-C class objects such as NSString, NSArray, NSDictionary, NSSet, NSDate, NSNumber, and 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:
Read now
Unlock full access