• 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: Deleting preference file from within the application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting preference file from within the application


  • Subject: Re: Deleting preference file from within the application
  • From: Andy Lee <email@hidden>
  • Date: Tue, 29 Apr 2008 02:18:27 -0400

If you call this, the prefs file will be deleted for you, and will stay deleted:


[[NSUserDefaults standardUserDefaults]
removePersistentDomainForName:@"bundle.identifier.for.your.app"];



I tested this by calling it in -applicationWillTerminate:. I assume you could call it sooner.


To see your app's bundle identifier, go to Targets -> YourApplication - > Get Info (Command-I) -> Properties -> Identifier. (I mention this because I forgot where it was specified myself and had to dig around.)

--Andy


On Apr 29, 2008, at 12:22 AM, Andrew BusH wrote:

Hi all,

I am attempting to add an 'Uninstall' option to an application, to do this I remove all the support files and then finally delete the preferences file and terminate the application.

unfortunately (albeit unsurprisingly) the last thing the application does before it quits is write out the preferences, thereby recreating the preferences file.

is there anyway to stop the application from doing this? Ive looked through NSUserDefaults but there is nothing there that looks up to the job.

does anyone have any ideas?


thanks for any help.


- Andrew

_______________________________________________

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

_______________________________________________

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


  • Follow-Ups:
    • Re: Deleting preference file from within the application
      • From: Andy Lee <email@hidden>
References: 
 >Deleting preference file from within the application (From: Andrew BusH <email@hidden>)

  • Prev by Date: Re: Problems with Launchd Daemon
  • Next by Date: Re: Problems with Launchd Daemon
  • Previous by thread: Re: Deleting preference file from within the application
  • Next by thread: Re: Deleting preference file from within the application
  • Index(es):
    • Date
    • Thread