Skip to content

Instantly share code, notes, and snippets.

@djburdick
Last active October 19, 2018 02:36
Show Gist options
  • Save djburdick/9198478 to your computer and use it in GitHub Desktop.
Save djburdick/9198478 to your computer and use it in GitHub Desktop.
XCode Shortcuts. #xcode

XCode shortcuts:

Setup:

  • Add a breakpoint to catch on all exceptions - under the breakpoints menu on the left click the + sign at the bottom and add “Add Exception Breakpoint”

Building:

  • Run - cmd+r
  • Build - cmd+b

Code:

  • Indent block - cntrl+i
  • create view property - cnt+click on view item in .xib then drag the item to the view

Navigation:

  • Jump to file - cmd+shift+o
  • Jump between header and implementation - cnt+cmd+up/down
  • Jump back/forward - cnt+cmd+<-/->
  • Search project - cmd+shift+f

Docs:

  • opt+click on class name
  • cmd+click to jump into implementation
  • cmd+l to line jump

Debugging:

  • there's a stepout method
  • you can place a new breakpoint while it's running
  • Print items in an array in gdb - po array[0]
  • Find what class type an object is when using gdb - po [object valueForKey:@"class"]

Notes:

  • can create your own code snippets - drag and drop code blocks into snippets
  • don't ignore warnings
  • IBOutlet doesn't mean anything to the compiler

Provisioning:

  • Refresh profile - Preferences -> View Details -> Refresh Button
  • Profiles and Archives - Window -> Organizer
  • Creating IPA file - 1. Product -> Archive 2. Window -> Organizer -> Archives 3. Distribute

Xibs / Storyboard

  • Choose elements behind the one in front - Shift+cntrl+click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment