Thread: XCode & braces
View Single Post
johnjay1

 
Member Since: Jan 24, 2009
Posts: 2
johnjay1 is on a distinguished road

johnjay1 is offline
Quote:
Originally Posted by Spook View Post
I don't like the K&R style, i.e.:

void Foo {
int n = 0;
...
}

I prefer the BSD style, which is prevalent among all the programmers I have worked with and which I prefer (it is easier to read):

void Foo
{
int n = 0;
...
}

How can I set XCode to use the BSD style, as currently it is setup for the K&R style? I have looked through the preferences but cannot see where!
Code:
$ defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator "\\n"
I use the Allman style (as it is cited in the ANSI C standard) and it too has an equivalent brace placement style.

Other various code style preferences: Xcode User Default Reference: Source Code Formatting User Defaults
QUOTE Thanks