开发者

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"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜