For almost 1 day and half I have been troubleshooting an odd situation where after my code that stops a NSTimer object, the application could crash mysteriously.
After combing sands over and over and over, I realized the crash was not in the code where I kill off the timer. Soon after reaching this conclusion I found the cause, and one reason it made it so hard to find this error was that even after you sent "invalidate" to a NSTimer object(according to Apple docs, invalidate remove the timer from run loop also cause the timer to be released!), your timer event handling code STILL could be called!
Why cannot Xcode point us more closely to where in the code the exception or "error" occurred?!
No comments:
Post a Comment