views:

80

answers:

1

I'm creating an in-app store for a few built-in features for my iphone app. Apple's documention recommends using the Application Preferences for storing this, but another question in this forum suggested using NSUserDefaults for another task for which Application Preferences was recommended (by Apple).

Can someone clarify if, for in-app store purchases, using the NSUserDefaults is a much better way to go?

Thanks.

A: 

I have not necessarily tried using App Prefs but can report that using NSUserDefaults was painless and seems to be working great. I just use this to store:

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:@"A.Value" forKey:@"MyApp.DataKey"];

and this to retrieve and check:

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSString *results = [defaults stringForKey:@"MyApp.DataKey"];
Joey