Debugging

From Medien Wiki

This page describes the debugging possibilites with Xcode, though the tools and concepts are very similar in different IDEs (Integrated Development Environments).


Debugger Console

Useful gdb commands when working with Objective-C:

print

  • print (int) myVar
  • print (int)[myObj retainCount]

po (print object)

  • po [myObject description]

set

  • set $myVar = @"Hello World!"
  • use temporary variables
  • great for creating and debugging short code snippets

show

  • show values prints all temporary GDB vars (eg.: $myVar)
  • help show to get all options

info symbol

  • info symbol 0xa0b06174
  • gets the symbolic name for an address

help

  • help prints command classes
  • help status prints list of commands

Don't forget there's a command completion (TAB & up-/down-arrows).

Resources




Diese Seite ist Teil des Werkmoduls iOS Development von Michael Markert für Interface Design / Fakultät Medien an der Bauhaus-Universität Weimar.