<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hello.World &#187; Xcode</title>
	<atom:link href="http://matthew.delmarters.com/weblog/category/apple/xcode/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthew.delmarters.com</link>
	<description>The Blog of Matthew Delmarter</description>
	<lastBuildDate>Sat, 10 Dec 2011 09:42:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Getting Xcode to put opening braces on a new line</title>
		<link>http://matthew.delmarters.com/weblog/getting-xcode-to-put-opening-braces-on-a-new-line/</link>
		<comments>http://matthew.delmarters.com/weblog/getting-xcode-to-put-opening-braces-on-a-new-line/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 03:58:17 +0000</pubDate>
		<dc:creator>Matthew Delmarter</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://matthew.delmarters.com/?p=306</guid>
		<description><![CDATA[By default Xcode (the Apple Developer IDE) puts opening braces at the end of the current line like so: if&#160;(&#160;condition&#160;)&#160;{ &#160;&#160;&#160;&#160;&#160;//&#160;code&#160;here... } However I have been working on projects for years with a different convention: if&#160;(&#160;condition&#160;) { &#160;&#160;&#160;&#160;//&#160;code&#160;here... } Of course developers have different preferences here. One is not right and the other wrong &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>By default Xcode (the Apple Developer IDE) puts opening braces at the end of the current line like so:</p>
<div class="VisualSyntax"><code><span style="color: #000000"><br />
if&nbsp;(&nbsp;condition&nbsp;)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;code&nbsp;here...<br />
}</span><br />
</code></div>
<p>However I have been working on projects for years with a different convention:</p>
<div class="VisualSyntax"><code><span style="color: #000000"><br />
if&nbsp;(&nbsp;condition&nbsp;)<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;code&nbsp;here...<br />
}</span><br />
</code></div>
<p>Of course developers have different preferences here. One is not right and the other wrong &#8211; that is dictated by a company or by a project, or by the consensus of the developers starting a new project. Once a convention is in place then it must be adhered to for the life of the project. And of course a decent IDE will work with developers preferences. </p>
<p>So &#8211; how do we get Xcode to support this alternate convention? The problem being that there is no UI preference to set this.</p>
<p><strong>To change this preference the quick way:</strong></p>
<p>Open the Terminal App and paste the following code:</p>
<div class="VisualSyntax"><code><span style="color: #000000"><br />
defaults&nbsp;write&nbsp;com.apple.Xcode&nbsp;XCCodeSenseFormattingOptions&nbsp;-dict&nbsp;BlockSeparator&nbsp;"\n"</span><br />
</code></div>
<p>Then restart Xcode. Thats it.</p>
<p>What does this do? It places a new entry in a plist file that is located in your user Home Directory. Home > Library > Preferences > com.apple.Xcode.plist.</p>
<p>Next time you start coding in Xcode it will autocomplete with opening braces on a new line.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthew.delmarters.com/weblog/getting-xcode-to-put-opening-braces-on-a-new-line/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

