TigerCoding
TigerCoding

Reputation: 8720

Is there a way to change bracket placement and indentation in Xcode?

I want to change the default behavior of XCode (4) for aligning brackets from this:

- (BOOL)someValue {
    return _someValue;
}

To this:

- (BOOL)someValue
{
    return _someValue;
}

I've reviewed the docs here:

http://developer.apple.com/library/ios/#documentation/DeveloperTools/Reference/XcodeUserDefaultRef/100-Xcode_User_Defaults/UserDefaultRef.html#//apple_ref/doc/uid/TP40005535-CH3-SW57

But I still dont' understand how to make the change. Any help?

Upvotes: 4

Views: 884

Answers (2)

Bean
Bean

Reputation: 21

You could try using an application called Snippet Edit that allows you to easily edit all of the supplied code snippets. You will need to be using Xcode v4.3 or later though if you wish to use it.

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

Upvotes: 0

Michael Dautermann
Michael Dautermann

Reputation: 89509

First off, the documentation you referred to is for XCode 3.1 (I've linked the introduction page which says so clearly). Judging by the number of comments on devforums.apple.com about this, I think the XCCodeSenseFormattingOptions key no longer exists under the new XCode4 defaults (which are stored under bundle ID com.apple.dt.XCode). If you want this particular feature restored, file a bug with Apple.

Secondly, you might be able to do what you're looking for by modifying templates. I discovered this very related question, but there's no tacit confirmation there that the suggestion actually succeeded.

Upvotes: 3

Related Questions