Permalink
Browse files

If available currency defaults to NSLocaleCurrencyCode

  • Loading branch information...
1 parent d1f9014 commit 02672e147264969528664600022c2f7c5a8b9412 @iosdeveloper iosdeveloper committed Jul 25, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 Classes/AppSalesAppDelegate.m
@@ -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];

0 comments on commit 02672e1

Please sign in to comment.