• 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
afterDelay not working?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

afterDelay not working?


  • Subject: afterDelay not working?
  • From: GW Rodriguez <email@hidden>
  • Date: Thu, 26 Jan 2012 20:56:02 -0800 (PST)

I have a simple NSView class that is an indicator light that I want to flash.  Here are the two methods to perform the flash:

-(void) performFlash {
    if (ledOn) return;
    
    ledOn = YES;
    [selfsetNeedsDisplay:YES];
    [selfperformSelector:@selector(endFlash) withObject:nilafterDelay:0.1];
}


-(void) endFlash {
    if (!ledOn) return;
    NSLog(@"Turning off LED");
    
    ledOn = NO;
    [selfsetNeedsDisplay:YES];
}


For some reason the afterDelay method isn't working.  I know my simple methods work because when I call endFlash independently it works just fine.  I have tried every permutation of the afterDelay method, I tried putting it in the delegate class, I tried using a NSTimer scheduleTimerWithTimeInterval: with no success.  

I am completely stumped on something that should be extremely straightforward.  Is there ANY instance where the afterDelay method wont work?  I'm pulling my hair out on this one.

Thanks
GW

_______________________________________________

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: afterDelay not working?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: ARC and blocks
  • Next by Date: Re: How to open CMYK TIF in Cocoa?
  • Previous by thread: Binding Leak - Turn off Raises For Not Applicable Keys
  • Next by thread: Re: afterDelay not working?
  • Index(es):
    • Date
    • Thread