Skip to content

Instantly share code, notes, and snippets.

@corysullivan
Created December 8, 2014 22:09
Show Gist options
  • Select an option

  • Save corysullivan/1222fca846fdb103511c to your computer and use it in GitHub Desktop.

Select an option

Save corysullivan/1222fca846fdb103511c to your computer and use it in GitHub Desktop.
- (void)configureDefaults
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *currencyCode = [[NSLocale currentLocale] objectForKey:NSLocaleCurrencyCode];
NSNumber *selectedRow;
//On first open select the first item if a portfolio does exist
selectedRow = ([Portfolio MR_countOfEntities] > 0) ? @1 : @-1;
NSDictionary *standardDefaults = @{SBI_DEFAULT_CURRENCY:currencyCode,
kSelectedRow:selectedRow,
FIRST_RUN:@YES,
@"SUUpdaterChecksForBetaUpdates":@NO,
@"SUUpdaterIsInTestMode":@YES
};
[defaults registerDefaults:standardDefaults];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment