Xcode 4: Opening brackets on the same line

I just installed Xcode 4, and the opening bracket of the automatically generated functions is on a new line.

For instance:

- (void)dealloc { [_window release]; [super dealloc]; } 

I would like to have an open shape on the same line as in Xcode 3:

 - (void)dealloc { [_window release]; [super dealloc]; } 

Can someone help me?

Thanks.

+2
source share
4 answers

MarkC's answer has the right idea, but <Jedi> are not the templates you are looking for </Jedi>.

The templates required for editing are in

 /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates 

or

 /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Templates 

depending on the platform you are targeting.

+4
source

Do not edit these templates directly! Apple usually automatically deletes them when upgrading to the next version of Xcode ...

Instead, you want to copy / paste them into:

 ~/Library/Developer/Xcode/ 

eg:.

 ~/Library/Developer/Xcode/File Templates/ ~/Library/Developer/Xcode/Project Templates/ 

... and then edit them there. Xcode knows what it should look there for your custom versions, and Apple will leave the contents of your home directory.

+3
source

All the template code that Xcode 4 uses to create new class files is located in / Developer / Library / Xcode / Templates / File \ Templates / Cocoa / Objective-C \ class.xctemplate

Just edit these templates to suit your coding style and you will be fine.

+1
source

You can try using the Snippet Edit application, which makes it easy to edit all provided code snippets. You will need to use Xcode v4.3 or later, but if you want to use it.

The app can be found at http://cocoaholic.com/snippet_edit/

0
source

Source: https://habr.com/ru/post/1383270/


All Articles