NSTimer crashes, when I call [Timer isValid] or [Timer invalidate]
You should set an NSTimer
object to nil
after you invalidate
it, since the invalidate
method call also does a release
(as per the Apple docs). If you don't, calling a method on it like isValid
could cause your crash.
Most likely the timer stored in that variable has already been deallocated. You need to retain it if you want to keep it around for an arbitrarily long time.
[objTimer retain];
Then it will not crash any time. Use this after initializing the timer so it will work fine....