dobiho
dobiho

Reputation: 1035

NSUserDefaults in iOS 8 and under iOS 8

I know NSUserDefaults saves data in a app, so data is cleared after deleting app under iOS 8. but data persists after deleting app in iOS 8.

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

Below codes works in iOS 8 (data is cleared after deleting app)

NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.AppCompany.Appname"];

Does this code works under iOS 8?

Upvotes: 0

Views: 511

Answers (1)

Banker Mittal
Banker Mittal

Reputation: 1918

If you are running your application in ios Simulator NSUserDefaults will not be cleared . it is the simulator bug .It work perfectly in ios device.

Upvotes: 1

Related Questions