• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: DOESN'T RESTORE PREFS UNLESS APP IS QUIT.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DOESN'T RESTORE PREFS UNLESS APP IS QUIT.


  • Subject: Re: DOESN'T RESTORE PREFS UNLESS APP IS QUIT.
  • From: "Laurent Daudelin" <email@hidden>
  • Date: Wed, 04 Feb 2004 10:59:05 -0500

On 04/02/04 10:43, "email@hidden" <email@hidden> wrote:

> I have the following routine that is exicuted when the "Apply" button is
> pressed.
> _______________________________________________
>
> - (IBAction)savePrefs:(id)sender
> {
> [[NSUserDefaults standardUserDefaults] setObject:[myPopUp
> titleOfSelectedItem] forKey:@"Active Device"];
> [[NSUserDefaults standardUserDefaults] setInteger:[allowUSB state] forKey:
> @"Allow USB"];
> [[NSUserDefaults standardUserDefaults] setInteger:[enableAtStart state]
> forKey:@"Enable At Start"];
> }
> _______________________________________________
>
> However, if I don't click the "Apply" button and re-enter the preference at a
> later time, it doesn't resorts back to the saved prefs, how do I force this
> without quiting the app?
>

You would probably have to set the values of your GUI widgets with the saved
prefs. What happens here is that when you change the values of those widgets
in the window, those widgets save their state so that the next time they are
displayed, they are still showing the latest values you entered. Just make
sure that you update their values with the saved preferences before showing
the window.

-Laurent.
--
========================================================================
Laurent Daudelin Developer, Multifamily, ESO, Fannie Mae
mailto:email@hidden Washington, DC, USA
************************ Usual disclaimers apply ***********************
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >DOESN'T RESTORE PREFS UNLESS APP IS QUIT. (From: email@hidden)

  • Prev by Date: DOESN'T RESTORE PREFS UNLESS APP IS QUIT.
  • Next by Date: Re: Cocoa/Windows parallel dvlpmt
  • Previous by thread: DOESN'T RESTORE PREFS UNLESS APP IS QUIT.
  • Next by thread: Re: DOESN'T RESTORE PREFS UNLESS APP IS QUIT.
  • Index(es):
    • Date
    • Thread