Browse Source

Local timezone added when app is opened the first time.

v1.4.1
Abhishek Banthia 8 years ago
parent
commit
f1b1eb9937
  1. 18
      Clocker/ApplicationDelegate.m

18
Clocker/ApplicationDelegate.m

@ -84,8 +84,7 @@ void *kContextActivePanel = &kContextActivePanel;
NSNumber *opened = [[NSUserDefaults standardUserDefaults] objectForKey:@"noOfTimes"];
if (opened == nil)
{
[[NSUserDefaults standardUserDefaults] setObject:[NSMutableArray array]
forKey:CLDefaultPreferenceKey];
[self getLocalTimezoneObject];
NSInteger noOfTimes = opened.integerValue + 1;
NSNumber *noOfTime = @(noOfTimes);
[[NSUserDefaults standardUserDefaults] setObject:noOfTime forKey:@"noOfTimes"];;
@ -113,11 +112,24 @@ void *kContextActivePanel = &kContextActivePanel;
[[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions": @YES }];
[[Crashlytics sharedInstance] setDebugMode:NO];
[[Crashlytics sharedInstance] setDebugMode:YES];
[Fabric with:@[[Crashlytics class]]];
}
- (void)getLocalTimezoneObject
{
CLTimezoneData *currentTimezoneObject = [[CLTimezoneData alloc] init];
[currentTimezoneObject setIDForTimezone:[NSTimeZone systemTimeZone].name];
[currentTimezoneObject setLabelForTimezone:[NSTimeZone systemTimeZone].name];
[currentTimezoneObject setFormattedAddressForTimezone:[NSTimeZone systemTimeZone].name];
CLTimezoneDataOperations *dataOperations = [[CLTimezoneDataOperations alloc] initWithTimezoneData:currentTimezoneObject];
[dataOperations save];
}
- (void)setupDatabase
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);

Loading…
Cancel
Save