Re: problems in runModal in NSOpenPanel used with defaults
Re: problems in runModal in NSOpenPanel used with defaults
- Subject: Re: problems in runModal in NSOpenPanel used with defaults
- From: "Michael Ash" <email@hidden>
- Date: Sat, 27 Sep 2008 16:11:56 -0400
On Sat, Sep 27, 2008 at 1:34 AM, spartan g <email@hidden> wrote:
> Thanks Corbin,
> I have used your tips in the updated code.
> Besides, my aim is to save the filename selected through the panel to a
> pList file timely whenever it is changed, so I am using synchronization of
> defaults. I checked and found that there is no resetStandardUserDefaults
> used anywhere in the entire project.
> I tried implementing dictionary insted of defaults and updating the pList
> contents accordingly.
> But to my surprise, in either cases(dictionary/defaults), whenever I click
> browse and click cancel/open the junk values are appended automatically in
> the pList file!!! For the time being I am deleting and recreating the file,
> but it doesn't seem a good alternative!!!
> How can a 'Panel runModal' add such junk in the pList!!!
I believe you attempted to show the junk values you were getting in
your first e-mail, however they did not appear to me. So this is just
a guess....
I suspect that you're seeing entirely normal autosave information
being generated by NSOpenPanel. That plist is not exclusively yours.
It holds all user defaults for your program. Any library in your
program, such as AppKit, is free to use that plist to store its own
values as well. This is normal, harmless, and expected. NSOpenPanel
will store values in user defaults to remember its position, size,
selection, and other such values.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden