running a timer while displaying a sheet
running a timer while displaying a sheet
- Subject: running a timer while displaying a sheet
- From: Nick Rogers <email@hidden>
- Date: Sat, 16 Oct 2010 16:59:33 +0530
Hi,
When I run a sheet, I want it to display a text field which has to be updated every second or so (basically showing a count down "60 Seconds", "59 Seconds" and so on.
I am starting a timer in main thread using:
timerRawScanMsg = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(myTimerFireMethod:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:timerRawScanMsg forMode:NSModalPanelRunLoopMode];
[[NSRunLoop currentRunLoop] addTimer:timerRawScanMsg forMode:NSEventTrackingRunLoopMode];
Then I'm starting the sheet using:
[NSApp beginSheet:windowRawScanMsg modalForWindow:windowMain modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:nil];
The myTimerFireMethod: is not getting called, which would update the text field in the sheet.
Any help would be greatly appreciated.
Wishes,
Nick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden