Re: No longer use NSLog() in Xcode 4?
Re: No longer use NSLog() in Xcode 4?
- Subject: Re: No longer use NSLog() in Xcode 4?
- From: Matt Neuburg <email@hidden>
- Date: Thu, 15 Sep 2011 10:29:42 -0700
On Thu, 15 Sep 2011 09:43:00 -0700, Jerry Krinock <email@hidden> said:
>I'm trying very hard to embrace change and get on board with Xcode 4. The worst thing for me is the loss of User Scripts, in which I had keyboard shortcuts for adding and bulk-removing NSLog() statements in a flash.
>
>Back in one of those rambling Xcode 4 threads on July 24, Patrick William Walker wrote:
>
>"The new action triggers inside the debugger are pure freakin' gold. I haven't used NSLog() in weeks now."
>
>I can't find any documentation on "action triggers". I'd appreciate an explanation of what "action triggers" are, and how they obviate NSLog(). I hope they does not require running with breakpoints on.
He's talking about a breakpoint that logs and continues. But, as you say, this requires that breakpoints be turned on. In early versions of Xcode 4 this feature was broken (it worked, but the interface claimed we were paused at the breakpoint), but it seems okay now.
My favorite way to deal with NSLog, stolen from Jens Alfke, is to call MyLog instead, with a definition in the precompiled header like this:
#define MyLog if(0); else NSLog
When it's time to stop logging, change the 0 to 1. So elegant. m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden