Re: Memory Management Question
Re: Memory Management Question
- Subject: Re: Memory Management Question
- From: Seth Pellegrino <email@hidden>
- Date: Tue, 3 Jul 2007 13:13:57 -0400
On Jul 2, 2007, at 11:46 AM, Daniel T. Staal wrote:
On Mon, July 2, 2007 11:40 am, Seth Pellegrino said:
Any particular reason you are trying to use objects after disposing of
them? In general, you don't throw things away until you are _done_
with
them...
Mainly my problem is with the NSTimer class. Whenever the user clicks
pause in my application, I call -[invalidate] to stop the timer from
firing (as there seems to be no -[pause] or similar). However, this
causes the run loop to release the timer, so whenever I try to call -
[isValid], my program crashes. As I type this, I realize that I
should be also -[retain]ing my instance of the NSTimer class, but if
I do so, is there a way to make an invalidated timer resume firing?
Or would it be better to just use a BOOL isPaused and an if statement?
Also, to everyone else who responded, thank you very much for your
great information! I'm sure the NSZombie will come in very handy in
the future.
Seth
_______________________________________________
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