Permalink
Browse files

Merge pull request #215 from iosdeveloper/master

If available currency defaults to NSLocaleCurrencyCode
  • Loading branch information...
2 parents d1f9014 + 02672e1 commit 4222a962719389c82957979597f5dae17e15723d @omz 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 4222a96

Please sign in to comment.