For quick and dirty project debugging, I often find myself using code like:
{
NSLog(@"-someRandomMethod called");
// ...
}
Playing around with precompiled headers in XCode, it occurred to me there’s a much neater way to do this. In the precompiled header (XCode probably created a .pch file for you) add:
Then in any method in your project you can get easy tracing:
{
HELLO
// ...
}
To prevent trace messages ever showing up in release builds, you could wrap the definition in an #ifdef and make the macro effectively a no-op.