You are here: Home Development OS X Xcode

Xcode

Information, tips, and scripts for Xcode.

Xcode has come a long way from what it was in version 1.0; it's actually usable.  Apple really, really should release an API for people to write plugins.  Alas, Apple is really odd that way.

 

Debugging

Here is some information about debugging in Xcode.

Setting environment variables

There are several environment variables that can be set to aid in debugging.  Remembering what they all are can be a pain.  This snippet is a little AppleScript to set the for you.

-- Script to turn on Cocoa debugging options for a the active executable of an XCode project. See <Foundation/NSDebug.h>
-- For extra points change "project document 1" to whatever the right specifier for front most project document.

on createvariable(inName, inValue)
	tell application "Xcode"
		set theExecutable to active executable of project document 1 of application "Xcode"
		if (every environment variable of theExecutable where name is inName) is {} then
			make new environment variable at end of theExecutable with properties {name:inName, value:inValue, active:true}
		end if
	end tell
end createvariable

createvariable("NSDebug", "YES")
createvariable("NSZombieEnabled", "YES")
createvariable("NSZombieEnabled", "YES")
createvariable("NSDeallocateZombies", "NO")
createvariable("NSHangOnUncaughtException", "NO")
createvariable("NSEnableAutoreleasePool", "YES")
createvariable("NSAutoreleaseFreedObjectCheckEnabled", "NO")
createvariable("NSAutoreleaseHighWaterMark", "0")
createvariable("NSAutoreleaseHighWaterResolution", "0")

 

Document Actions
« September 2010 »
September
MoTuWeThFrSaSu
12345
6789101112
13141516171819
20212223242526
27282930