• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
problem with NSTimer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with NSTimer


  • Subject: problem with NSTimer
  • From: Kiran Kumar S <email@hidden>
  • Date: Fri, 8 May 2009 15:21:23 +0530

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 (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


  • Follow-Ups:
    • RE: problem with NSTimer
      • From: Gopinath Srinivasan <email@hidden>
    • Re: problem with NSTimer
      • From: Michael Ash <email@hidden>
  • Prev by Date: Re: ViewControllers and window nibs
  • Next by Date: Re: ViewControllers and window nibs
  • Previous by thread: Re: [iPhone] Grouped TableView baffling problem
  • Next by thread: Re: problem with NSTimer
  • Index(es):
    • Date
    • Thread