Archiving Object
Hello all,
I have a doc-based cocoa app, and I want to simply archive an object, much like how a NIB archives them. I want a simple way - nothing complicated. Any advice on this?
I have a doc-based cocoa app, and I want to simply archive an object, much like how a NIB archives them. I want a simple way - nothing complicated. Any advice on this?
The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
also, if the object you're trying to archive is an NSArray or an NSDictionary, you can use writeToFile:atomically: to save the object as a .plist file. This is convenient because it's human readable.
That even works with nested arrays, dictionaries, and basic objects (like NSNumber, NSString, etc)
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
It's a custom Class. To invoke NSArchiver on it seems to tell me that I need to denote some NSEncoder method in my custom class?!
You have to implement the NSCoding protocol - check the docs on archiving.
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Pointers & Archiving in Cocoa | Shivers | 6 | 3,481 |
Apr 4, 2005 02:36 AM Last Post: DoG |
|

