On 19/03/2013, at 10:21 AM, Rick Mann <[email protected]> wrote:

> t seems like an NSArchiver subclass could call -encodeWithCoder: to create a 
> dictionary that could live in a plist file (as opposed to creating an 
> NSData), and it could easily be used transparently. The advantage to this is 
> twofold: you avoid a couple extra lines in your code each time you access the 
> pref, and the prefs plist is human-readable.


You still have to ensure that the dictionary only contains valid property list 
objects though, which limits you to fairly fundamental types. In most cases it 
would probably work, but you still need to be aware of it in your 
encodeWithCoder method.

For example, a NSColor is a typical object that you might want to save in 
prefs, but isn't a property list object. One way or another it has to be 
encoded in some other form.

--Graham




_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to