Posts tagged interface_builder

Quick and Easy Drawing Performance Debugging with NSShowAllDrawing

While watching one of the WWDC09 session videos I was informed of a great tip that I had been previously unknown to me: Pass -NSShowAllDrawing YES as an argument to your application in Xcode to see a visual representation of the drawing that your application performs as it runs.

To illustrate how NSShowAllDrawing works and the issues it can help you correct I’ve put together two videos.  The first shows my app, Bezipped, in its current 1.0 state and its current drawing behavior.

This second video shows how I improved the drawing in Bezipped simply by setting the top-level container to be backed by a Core Animation layer:

I highly recommend giving your app a spin with NSShowAllDrawing if you haven’t already, it was certainly a real eye-opener for me.  There are some additional resources for debugging your drawing performance on OS X (as pointed out to me by André Pang) provided by Apple here: Drawing Performance Guidelines: Measuring Drawing Performance

Lastly, both Alan Rogers and Steve Streza pointed me towards Quartz Debug.app (included with the developer tools) as another means to see similar redrawing behavior.  I found Quartz Debug’s options to be a bit heavy-handed as the drawing performance of the entire OS was shown instead of just my app, but your mileage may vary.

The Best Interface Builder Layout Ever

This morning I posted a screenshot of my Interface Builder layout on Twitter.  I didn’t think much of it at the time, but I received enough positive feedback on it that I decided to post it here for generations of future Cocoa developers to find.  The layout gets harder to work with the smaller your screen gets, but it works very well on my 24″ display.  Another tip for working well with IB: keep it in it’s own space and don’t let other apps invade that space.  I find that when I can concentrate just on my IB windows without having to mentally block out background windows it makes my workflow much smoother.

IB Layout