Monday, June 7, 2010

How to Make Instruments Show Your Own Code

Debugging memory leaks with Instruments. Great tool, but would be more useful, if I could see there references to my code.

Turned out it's a known iPhone OS 3.0 defect, almost two years old! No idea why it hasn't been fixed by Apple. Maybe old SDKs are not supported on purpose, which does make some business sense.

How to fix: Go to your Xcode project, select project info, go to Build tab and search Base SDK. Change your project Base SDK to 3.1. I had there 3.0, which seems to be a known defect.
  • Build - Clean All Targets - select all - Clean
  • Build - Build and Analyze
  • Run - Run with Performance Tool - Leaks
  • Stop
  • Open popup item with application name - Launch Executable - Choose Executable
  • Browse to your Build directory and select your application
  • Record (the red Dot button)
It's not enough to start your application from Instruments, but you also have to choose the file. Stop and Record is not enough.

No comments:

Post a Comment