Cocoa in the Shell

Debug a Preference Pane with Xcode 3

Here is a quick tip to help you debug your Preference Pane with Xcode, because debugging with NSLog() is painful and not very productive.

So, open your project with Xcode, go to the Project menu and chose News Custom Executable.

In the Executable Path field, chose /Applications/System Preferences, and for the name of the executable, chose whatever you want.

Now you can put breakpoints in your code and debug it as you normally do.

When you will hit the debug button to launch your project, System Preferences will launch, then click on your Preference Pane to load it and you are good to go.

Tags: ,