Become Master of Xcode
For iPhone development guys (and Mac as well), we all want to be as productive as possible. And one of our important tools is Xcode. I can even say that if we can master of Xcode, we can double our productivity. The reason is not only the time that the tool can save us but the number of times it breaks our workflow, or make us become bored/tired of our jobs. We are all humans, and no human in the world wants to do the job that a machine can do. Ok, stop talking and I will show you my summary of tips/tricks and techniques that I feel very very useful for me.
Many of these tips is from this stackoverflow post (I just list what I feel is most productive), 2 famous videos called “Becoming productive in XCode”, and a famous cheat sheet that almost all of us know “Complete Xcode Keyboard Shortcut List”
I also recommend you to go there and take a look because this post may be really personal and lack excellent tips that you want.
1/ Basic Hot Keys
File Cursor Movement
- Header/Source File Switching: Option + Command + Up Arrow
- Last cursor point switch back and forward: Option + Command + Left (Right) Arrow
Quick Help/Documentation
- Jump to Definition of a symbol : Command + Double-Click on a symbol
- Find Text in Documentation of a symbol: Option + Double-Click on a symbol: (Only works if you have they symbol’s Doc Set installed.)
Auto Complete
- (previous) next auto-completion argument : (Shift) + Control + /
- Auto completion pop-up list : Escape or Control + comma
- (previous) next Auto completion choices movement: (Shift) + Control + period
Text Movement:
- Cursor movement between words : Option + Left (Right) Arrow
- Cursor movement camel-cased parts of a word: Control + Left (Right) Arrow
- Beginning or end of line: Command + Left (Right) Arrow
Interface Builder:
- Jump to class in Xcode : Command + Double-click on an object in Interface Builder’s
- Drag a customized object back to Interface Builder’s Library for later reuse.
- Object overlap, see object menu under mouse: Control + Shift + Click on an object :
Code Organizing:
- Bold line in the function list: #pragma mark Foo
- Auto complete the pragma: pm or #p
- Notation convention: // TODO: or // FixMe
- Commenting a line: Command + /
2/ Advanced Hot Keys
With advanced hot keys, you will rarely need to use the mouse. Because, everything you need to do with the mouse, you can do it with the hot keys.
- Open File Quickly : Command + Shift + D and don’t forget that open quickly uses the current word as a search term.
- Popup list of methods and symbols in the current file : Control + 2
- Look up current symbol: Control + Command + ?
- Editor area to full screen : Command + Shift + E
- Debug and Editor Mode switch in All-In-One XCode mode : Command + Shift + B
3/ Some useful scripting
I will tell you more about scripting in the next part, but currently, I think this list is basic enough:
Default Auto Completion list, show when you type
defaults write com.apple.Xcode XCCodeSenseAutoSuggestionStyle List
Turn Off Undo Warning
defaults write com.apple.Xcode XCShowUndoPastSaveWarning NO
Hope that now you can code iPhone app much faster with XCode
Thank you very much my friend, you are very kind in sharing this useful information with? others…. The details were such a blessing, thanks.
Marie Chelle
16 Sep 10 at 10:31 am
Fabulous post! Loved reading your great post, I always can tag it
Benito III
25 Sep 10 at 8:44 pm
[...] you are just a newbie, it is not easy to solve. You may also want to take a look at my first part: Become Master of XCode Many of the techniques are learnt from “Becoming productive in [...]
Become Master of XCode (part 2) « Software Development, Research and Learn
27 Sep 10 at 9:23 am
what do you mean? Do you intend to say something?
Khang Vo
31 Jan 11 at 10:55 am
Ya learn soemthing new everyday. It’s true I guess!
Tiger
26 Jun 11 at 11:20 pm