realbasic-nug
[Top] [All Lists]

Re: How to handle prefs with OO

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: How to handle prefs with OO
From: Charlie Boisseau <charlie at boisseau dot co dot uk>
Date: Thu, 31 Mar 2005 17:31:39 +0100
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <30245 dot 1112266813 at www35 dot gmx dot net> <2447f60740a0d18ebcb087b435531651 at mac dot com>
On 31 Mar 2005, at 13:20, Thomas Reed wrote:

If you're doing cross-platform work, though, you can mimic this behavior with a class that reads from a file into a dictionary pretty easily. Somebody (Kevin Ballard, maybe?) has a class for turning XML into a dictionary and vice versa, though I forget what it's called and have never used it.

This is exactly what I have done. I use Kevin's XMLDictionary which can read and write .plist files and the module I mentioned before to access the values in the dictionary. It is extremely simple. I don't have to access the dictionary directly at all (unless I want to).

This was great for me, because I used to use the built-in OS X API for accessing prefs, but ran into trouble when porting to Windows. I didn't want to maintain two code-bases, so I replaced the OS X API with calls into the dictionary, which is handled by Kevins class. Not only did this mean I was working with one code base, but it was backward-compatible with the old .plist pref files.

--
Charlie Boisseau

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>