• 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
Re: "unused" NSTimer variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "unused" NSTimer variable


  • Subject: Re: "unused" NSTimer variable
  • From: John Randolph <email@hidden>
  • Date: Fri, 26 Sep 2003 15:50:28 -0700

On Sep 26, 2003, at 3:37 PM, Matt Budd wrote:

Try declaring it and initializing it on two seperate lines:

NSTimer *statusTimer;
statusTimer = [NSTimer scheduledTimerWithTimeInterval: 5.0 target:self selector:@selector(checkStatus) userInfo:nil repeats:YES];

Or, just make it an ivar, and deal with it in your -dealloc method:

- dealloc
{
if (statusTimer)
[statusTimer invalidate];
[super dealloc];
}

John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: "unused" NSTimer variable (From: Matt Budd <email@hidden>)

  • Prev by Date: Re: The Toolbar Widget
  • Next by Date: Re: The Toolbar Widget
  • Previous by thread: Re: "unused" NSTimer variable
  • Next by thread: Re: "unused" NSTimer variable
  • Index(es):
    • Date
    • Thread