Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
If available currency defaults to NSLocaleCurrencyCode
  • Loading branch information
iosdeveloper committed Jul 25, 2012
1 parent d1f9014 commit 02672e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/AppSalesAppDelegate.m
Expand Up @@ -32,8 +32,14 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
srandom(time(NULL));
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

NSString *currencyCode = [[NSLocale currentLocale] objectForKey:NSLocaleCurrencyCode];
if (![[CurrencyManager sharedManager].availableCurrencies containsObject:currencyCode]) {
currencyCode = @"USD";
}

NSDictionary *defaults = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], kSettingDownloadPayments,
currencyCode, @"CurrencyManagerBaseCurrency",
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];

Expand Down

0 comments on commit 02672e1

Please sign in to comment.