fixed #1 problem with nap time

This commit is contained in:
Jeena 2014-05-11 19:42:57 +02:00
parent 73b1ae5e83
commit 2403c80c3f
3 changed files with 8 additions and 5 deletions

View file

@ -32,6 +32,7 @@
bool ongoing; bool ongoing;
NSTimer *repeatingTimer; NSTimer *repeatingTimer;
id<NSObject> action;
} }
@property (assign) NSTimer *repeatingTimer; @property (assign) NSTimer *repeatingTimer;

View file

@ -176,11 +176,15 @@
target:self selector:@selector(tick:) target:self selector:@selector(tick:)
userInfo:nil repeats:YES]; userInfo:nil repeats:YES];
self.repeatingTimer = timer; self.repeatingTimer = timer;
action = [[NSProcessInfo processInfo] beginActivityWithOptions:NSActivityUserInitiated reason:@"Timr needs to run every second"];
[action retain];
} }
- (void)stopRepeatingTimer:(id)sender { - (void)stopRepeatingTimer:(id)sender {
[repeatingTimer invalidate]; [repeatingTimer invalidate];
self.repeatingTimer = nil; self.repeatingTimer = nil;
[[NSProcessInfo processInfo] endActivity:action];
[action release];
} }
- (IBAction)changeDigit:(NSButton *)sender { - (IBAction)changeDigit:(NSButton *)sender {

View file

@ -224,7 +224,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = { 29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 0410; LastUpgradeCheck = 0510;
}; };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Timr" */; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Timr" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";
@ -314,7 +314,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO; GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5; GCC_MODEL_TUNING = G5;
@ -334,7 +334,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5; GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
@ -351,7 +351,6 @@
C01FCF4F08A954540054247B /* Debug */ = { C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
@ -364,7 +363,6 @@
C01FCF5008A954540054247B /* Release */ = { C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;