Wojtek
Wojtek

Reputation: 1044

Resetting mac application in xcode

How can I reset a cocoa application in Xcode? When I run my application from Xcode all user default are saved. I would like to reset (delete) my application to create a new one with new settings and run as it would be run first time.

I found one way - I change a name of my app to a different one and it is started as new. But how can I do this with an old name?

Upvotes: 4

Views: 1015

Answers (2)

superfell
superfell

Reputation: 19040

You can use the defaults command line tool to remove all the settings, you just need the bundle id of your app (which you can find in your Info.plist file), e.g. if your bundle id is "com.foo.barApp" then you can run this from a terminal shell:

defaults delete com.foo.barApp

Upvotes: 5

RyanR
RyanR

Reputation: 7758

Is your app limited to the App Store? If so, I don't think there's a way to delete your entire application, specifically because of the sandbox restrictions. We'd need more information on how you are planning to distribute it to help.

If you just want to delete your app settings, then clear whatever database you store your app data in - [NSUserDefaults +resetStandardUserDefaults], SQLite, App Library directory, whatever. That is dependent on how/where you are storing user data, there's no one size fits all solution.

Upvotes: 2

Related Questions