I'm newish to Objective-C and my memory management skills are not great. However, I haven't had a single problem until now. And now I've got big problems.
I've gone from zero crashes to crashing at random points, giving me either no console output or unrecognized selector errors on random types (-[NSCFSet isSameAsStop:]: unrecognized selector
- I don't even use any sets and I surely have not called my custom isSameAsStop on any sets.). Judging by the randomness and errors, it seems like a memory thing to me although I'm not entirely sure.
How do I go about debugging this? The debugger assumes you know where your problem is... and mine is just everywhere. Ideas?
SOLUTION COMMENT
Some clarification on the solution suggestion to "run with zombie detection enabled":
- Set the NSZombieEnabled to YES on the Executables' Arguments screen.
- Build and then choose Run with Performance Tool > Object Allocations, which will start Instruments.
- Click the "i" button on Object Allocations in Instr. and select zombie detection and retain counts.
- Rerun and click around in your app, it'll tell you when you hit a zombie!
Thanks for the help!