0

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 there a way of executing scripts like uncrustify in Xcode 4?

2 Answers 2

1

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...)

Sign up to request clarification or add additional context in comments.

Comments

1

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”.

1 Comment

Code snippets is the correct answer for having code comments as well. Thank you !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.