开发者

Xcode 4 code comments - or user scripts menu

开发者 https://www.devze.com 2023-02-25 20:26 出处:网络
in Xcode 3 there was a user scripts menu that included a couple of menu points for inserting a code comment template for methods, classes, etc.

in Xcode 3 there was a user scripts menu that included a couple of menu points for inserting a code comment template for methods, classes, etc. Now that Apple removed this menu I have 3 questions:

  1. still wondering what is the accepted way of adding comments to classes and methods ...
  2. is there a way we can insert these code comment templates by keyboard shortcuts ?
  3. is the开发者_StackOverflow社区re a way of executing scripts like uncrustify in Xcode 4?


Yes, the user scripts are gone!!! Sucks rocks.

You are not alone. Here is a way to use uncrustify

You can also resurrect your old scripts (kinda) as described here (login required...)


Excerpts from Writing and Editing Source Code in the Xcode 4 User Guide:

Xcode 4 provides libraries of file templates and code snippets that you can use in your program.

  • File templates range from templates for applications to subclasses of commonly used Cocoa classes. File templates have subcategories, which you can choose from the pop-up menu below the line of buttons. You can display the templates as icons only or as icons and text. Drag file and project templates to the project navigator.
  • Code snippets are short pieces of source code that you can use in your software. To use one, drag it directly into your source code file. Alternatively, you can select a portion of the code from the code information pop-up window and drag that into your file. When you create a code snippet, you can add a completion shortcut, which you can use when editing source code. Type the shortcut and select the completion shortcut from the completion list to add the code snippet to your file. Note that the new code snippet is flagged with the word “User”.
0

精彩评论

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