From 2403c80c3f1b4e0c4e66b6c14e8cfc67fa2db690 Mon Sep 17 00:00:00 2001 From: Jeena Date: Sun, 11 May 2014 19:42:57 +0200 Subject: [PATCH] fixed #1 problem with nap time --- Timer.h | 1 + Timer.m | 4 ++++ Timr.xcodeproj/project.pbxproj | 8 +++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Timer.h b/Timer.h index 9835c81..06bad6a 100644 --- a/Timer.h +++ b/Timer.h @@ -32,6 +32,7 @@ bool ongoing; NSTimer *repeatingTimer; + id action; } @property (assign) NSTimer *repeatingTimer; diff --git a/Timer.m b/Timer.m index a77dbe2..e26d1cc 100644 --- a/Timer.m +++ b/Timer.m @@ -176,11 +176,15 @@ target:self selector:@selector(tick:) userInfo:nil repeats:YES]; self.repeatingTimer = timer; + action = [[NSProcessInfo processInfo] beginActivityWithOptions:NSActivityUserInitiated reason:@"Timr needs to run every second"]; + [action retain]; } - (void)stopRepeatingTimer:(id)sender { [repeatingTimer invalidate]; self.repeatingTimer = nil; + [[NSProcessInfo processInfo] endActivity:action]; + [action release]; } - (IBAction)changeDigit:(NSButton *)sender { diff --git a/Timr.xcodeproj/project.pbxproj b/Timr.xcodeproj/project.pbxproj index ebfa30b..d5f66d8 100644 --- a/Timr.xcodeproj/project.pbxproj +++ b/Timr.xcodeproj/project.pbxproj @@ -224,7 +224,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0410; + LastUpgradeCheck = 0510; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Timr" */; compatibilityVersion = "Xcode 3.2"; @@ -314,7 +314,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; @@ -334,7 +334,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -351,7 +351,6 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -364,7 +363,6 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES;