Recording purchased products from in-app store for built-in products
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 sugge开发者_如何转开发sted 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.
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"];
精彩评论