Xcode Learning | 001

Learning from the Stanford course, very excellent!

So Practice and practice.

Key Command

  • Cmd + R: Run
  • Cmd + 0: Open/Hide navigator
  • Cmd + Option + 0: Open/Hide rihgt pane
  • Cmd + (1, 2, 3, 4, 5, 6, 7, 8, 9): Switch each tab of navigator
  • Cmd + Option + (1, 2): Switch each tab of right pane
  • Cmd + Shift + l: Open the object library
  • Cmd + Shift + y: Open/Hide the console and debugger pane at the bottom
  • Cmd + Option + Enter: Open the second pane in the editor
  • Cmd + Enter: Hide the second pane in the editor
  • Cmd + Shift + O: Search file and open.
  • Cmd + /: Comment/Undo Comment
  • Cmd + I: Format the codes

Pay attention the 0(zero) and O(Capitalize O).

Debugger

Xcode

  • Left: Console pane can see the detailed information of object
  • Right: Debugger pane can print out any object that we want to inspect.

Debugger commands:

  • po xxx(game, flipCount, emojiChoices)
  • p xxx(game, flipCount, emojiChoices)
  • ….

These commands are very helpful.

Debug methods:

  • step to next breakpoint
  • step over
  • step into
  • step over