Archives in Cocoa

Archives in Cocoa

If you need to save and load data from files, and you don’t mind creating binary files (don’t need to read or edit them), then Archives are the simplest way to go.

Load contents of file into an NSArray:

    NSArray* m_ProcessedFiles = [NSKeyedUnarchiver unarchiveObjectWithFile:destPath];

Save contents of array to file:

    [NSKeyedArchiver archiveRootObject:m_ProcessedFiles toFile:srcPath];       

Leave a Reply