New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

XCode & braces


Post Reply New Thread Subscribe

 
Thread Tools
Spook

 
Spook's Avatar
 
Member Since: Sep 20, 2008
Location: Surrey, UK
Posts: 17
Spook is on a distinguished road

Spook is offline
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!
QUOTE Thanks
kevindryer39

 
kevindryer39's Avatar
 
Member Since: Aug 17, 2008
Posts: 30
kevindryer39 is on a distinguished road
Mac Specs: Mac mini 1.66 GHz Intel Core Duo / 1GB 667 MHz DDR2 SDRAM / 80GB HD

kevindryer39 is offline
I think you are S.O.L. Spook. I looked through myself and could not find anything. What's even better, I google "K&R xcode" .... yeah, this thread is top search result
QUOTE Thanks
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
johnjay1

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

johnjay1 is offline
Just to supplement, this only applies to macros and code completion, not file templates. You'll need to "fix" the templates yourself.
QUOTE Thanks

Post Reply New Thread Subscribe


« PHPMYadmin | Custom View problems... »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Xcode Help! Kathe OS X - Development and Darwin 1 09-21-2008 02:57 PM
Carbon framework on XCode Rafi Shalom OS X - Development and Darwin 1 04-17-2008 01:14 PM
Xcode 1.5 alejandrico OS X - Development and Darwin 0 06-03-2006 05:56 PM
XCode Include path problem Jove OS X - Development and Darwin 0 03-18-2005 09:41 AM
New Xcode plug-in helps developers reuse code Murlyn OS X - Development and Darwin 0 11-10-2003 12:16 PM

All times are GMT -4. The time now is 03:43 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?