Where do you save preferences?

Peter Haworth pete at lcsql.com
Tue Jun 19 02:45:14 EDT 2012


I believe the class/API Richard refers to simply write the data they are
given to a file in the prefs folder that Apple wants you to use.  If you
give bad data to them, they will foul up the prefs file just as badly as
writing the same bad data directly from LC would foul it up.

I thnk Apple wants you to use the class/API so when they change their mind
again about where preferences should be, you'll be protected from that
change.

While I'm not familiar with the API, I would guess that it wants to
maintain the prefs file in plist format.  My prefs file isn't in plist
format and I don't want it to be so I can't use the API.  Unless of course
Apple decides to invalidate my app because it doesn't use plist format…...

However, I do agree that if you are writing an app that accesses one of
Apple's application's prefs file, then you'd better make sure it does it
correctly.  But once again, the API is just as capable of writing bad data
to the prefs file as LC is.

I've posted to the Apple Developer Forum about this issue and have had a
couple of replies but still nothing definitive.

Pete
lcSQL Software <http://www.lcsql.com>



On Mon, Jun 18, 2012 at 8:22 PM, Kay C Lan <lan.kc.macmail at gmail.com> wrote:

> >
> > What's new is that your app doesn't "write" there per se.  Apple is now
> > requiring that the OS write there on your behalf, using either the
> > theNSUserDefaults Cocoa class or the CFPreferences API.
> >
> > At face value this seems silly, since of course being able to write a
> file
> > to a given location isn't exactly rocket science truly requiring OS-level
> > support.
> >
> > Maybe, maybe not. From my observance of the Apple Forums I would say well
> over 90% of the advise given whenever OS X or an app starts misbehaving is:
> Start Disk Utility and 'Repair Disk Permissions'* and Trash the app
> Preference file.
>
> I've seen similar advise given on this List. As it clearly works, it would
> suggest that for whatever reason, Preference files are regularly not
> written correctly or are written in a way which corrupts other app
> Preference files.
>



More information about the Use-livecode mailing list