I am guessing you will have to configure your runloop in the appropriate mode 
(see NSRunLoop, and Run Loop Management in the docs), to specify the behavior 
of your timers.

Hope that helped,
~Gopinath


-----Original Message-----
From: cocoa-dev-bounces+gopinath=adobe....@lists.apple.com 
[mailto:cocoa-dev-bounces+gopinath=adobe....@lists.apple.com] On Behalf Of 
Kiran Kumar S
Sent: Friday, May 08, 2009 3:21 PM
To: Apple Mailing Mailing
Subject: problem with NSTimer

        according to documentation for
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: it
says that While the application is in the run loop, it does not
respond to any other events (including mouse, keyboard, or window-
close events) unless they are associated with the sheet. It also does
not perform any tasks (such as firing timers) that are not associated
with the modal run loop.
        But in my app the timer i had created fires even my main window is in
running as Modal

- (id)init
{
     self = [super init];
     if (self) {
        timer = [NSTimer scheduledTimerWithTimeInterval:5.0f target:self
selector:@selector(timerPinged:) userInfo:nil repeats:YES];
     }
     return self;
}

-(void)timerPinged:(NSTimer*)timere
{
     NSLog(@"timer pinged");
}
-(IBAction)raiseSheet:(id)sender
{
     [NSApp beginSheet:syncPanel modalForWindow:window
modalDelegate:nil didEndSelector:nil contextInfo:nil];
}

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/gopinath%40adobe.com

This email sent to gopin...@adobe.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to