Skip to content
This repository
Browse code

Merge pull request #215 from iosdeveloper/master

If available currency defaults to NSLocaleCurrencyCode
  • Loading branch information...
commit 4222a962719389c82957979597f5dae17e15723d 2 parents d1f9014 + 02672e1
Ole Zorn authored July 25, 2012

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  Classes/AppSalesAppDelegate.m
6  Classes/AppSalesAppDelegate.m
@@ -32,8 +32,14 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
32 32
 	srandom(time(NULL));
33 33
 	self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
34 34
 	
  35
+	NSString *currencyCode = [[NSLocale currentLocale] objectForKey:NSLocaleCurrencyCode];
  36
+	if (![[CurrencyManager sharedManager].availableCurrencies containsObject:currencyCode]) {
  37
+		currencyCode = @"USD";
  38
+	}
  39
+	
35 40
 	NSDictionary *defaults = [NSDictionary dictionaryWithObjectsAndKeys:
36 41
 							  [NSNumber numberWithBool:YES], kSettingDownloadPayments,
  42
+							  currencyCode, @"CurrencyManagerBaseCurrency",
37 43
 							  nil];
38 44
 	[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
39 45
 

0 notes on commit 4222a96

Please sign in to comment.
Something went wrong with that request. Please try again.