开发者

What are the must know shortcuts in Xcode for faster application development?

What are the must know shortcuts in Xcode for faster application development?

As a special interest, the Mac shortcut I want to know is the one to open application menus (File, Edit, View, Project, Build etc.,). In Windows, if we type Alt + F, th开发者_运维百科e File menu will drop down, and we can navigate through the sub-menus using the arrow keys or typing the letters that are underlined in the menus. How can we do something like that in Mac?

Thanks..


For debugging:

  1. CMD+SHIFT+I (step into)
  2. CMD+SHIFT+O (step)

Building & Running:

  1. CMD+B (build project)
  2. OPT+CMD+ENTER (debug project)


This is the PDF for all the shortcuts of Xcode

All Xcode Shorcuts

I hope it helps.


  • Alt + Cmd + Up to toggle between .h and .m files of a class
  • Cmd + ' to move to next error or warning
  • Cmd + Shift + ' to move to previous error or warning
  • Column Selection: Holding down the option key while dragging allows you to perform a column based selection of text. Might be useful in limited circumstances.


Control-. to select the next autocompletion, control-/ to select the next placeholder (add shift for previous), control-escape to show autocompletion list.

As a response to your request, if you have full keyboard access turned on, control-fn-F2 will select the menu bar. Then use the arrows to select an item, and space to choose it.


These shortcuts are for Xcode 3.2.x (they may vary from Xcode 3.1.x and other versions):

Command-double click on symbol/method name in source code editor > Open the .h file for symbol

Option-double click on symbol/method name in source code editor > Open the documentation for symbol

Command-Option-Shift-F > Find Selected Text in Project (custom shortcut)

I have the following one setup in User Scripts under Code to insert a standard logging call:

What are the must know shortcuts in Xcode for faster application development?

The inserted text is:

NSLog(@"[%@ %@]", NSStringFromClass([self class]), NSStringFromSelector(_cmd));


Shift-Command-D (Xcode 3.2) / Shift-Command-O (Xcode 4): Open quickly. Great way to get to the file you want.


"Alt + Cmd + Up to toggle between .h and .m files of a class"

This seems to have been disabled in Xcode 4. I've not been able to find a way to set it in Bindings, either. Any hints?

Update: Just found it. It has been changed to "Ctrl + Cmd + Up". It can also be executed with a three finger swipe up or down.

The command, by the way, is called "Jump to Next Counterpart". I knew that.... :-/

Sometimes it takes a Ph.D. in linguistics to figure computer terminology out. And I've been doing this since the early 80s.


Click on any method name in the Xcode. Then use ALT + CMD + / to insert comments describing the input and return parameters. This will encourage you to write descriptive comments explaining what is the method supposed to do, thus leading to a more maintainable code.


Use CMD + SHIFT + O to open the Open Quickly Dialog. While you type classes, methods and files will appear matching your entered description. Pressing enter will go to said method, class or file. This greatly improved productivity for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜