Re: "unused" NSTimer variable
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.