<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Cocoa code branching per release?</title>
	<atom:link href="http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/</link>
	<description>Musings from an independent developer, Cocoa, Rails, and UI for the most part.</description>
	<pubDate>Wed, 27 Aug 2008 23:21:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Sean Patrick O'Brien</title>
		<link>http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-2756</link>
		<dc:creator>Sean Patrick O'Brien</dc:creator>
		<pubDate>Mon, 16 Jul 2007 19:04:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-2756</guid>
		<description>&lt;p&gt;Check the release notes and connect.apple.com for info on a Tiger compatible IB version in 10.5.  You should be pleasantly surprised.  :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Check the release notes and connect.apple.com for info on a Tiger compatible IB version in 10.5.  You should be pleasantly surprised.  :)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Hanson</title>
		<link>http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-1752</link>
		<dc:creator>Chris Hanson</dc:creator>
		<pubDate>Sat, 30 Jun 2007 23:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-1752</guid>
		<description>&lt;p&gt;I doubt that would work; a 10.y SDK is free to use features from 10.y itself (for example, changes to the compiler, such as the introduction of a deprecation attribute in GCC 4 with Tiger) which may not be available on 10.x.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I doubt that would work; a 10.y SDK is free to use features from 10.y itself (for example, changes to the compiler, such as the introduction of a deprecation attribute in GCC 4 with Tiger) which may not be available on 10.x.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Zornek</title>
		<link>http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-1709</link>
		<dc:creator>Mike Zornek</dc:creator>
		<pubDate>Sat, 30 Jun 2007 08:21:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-1709</guid>
		<description>&lt;p&gt;@Chris Thanks so much for the help. One more question: I have a Tiger hard drive and a Leopard hard drive for my Mac Pro. Could I use Xcode 2.4 on Tiger and point it to the sdk living on the Leopard HD to build against that SDK? I ask cause I'm not ready to live in 10.5 yet. My NIBs (cause they use some open source IB Pallets that haven't been upgraded to IB 3 yet, and who even knows how ready IB3 is for such things) don't open in IB3 so it'd be really awkward to do all the code in Xcode and reboot to 10.4 just to edit the NIBs.&lt;/p&gt;

&lt;p&gt;Old IB used to be in the seeds. I don't know where it went. :-(&lt;/p&gt;

&lt;p&gt;Thanks again.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Chris Thanks so much for the help. One more question: I have a Tiger hard drive and a Leopard hard drive for my Mac Pro. Could I use Xcode 2.4 on Tiger and point it to the sdk living on the Leopard HD to build against that SDK? I ask cause I&#8217;m not ready to live in 10.5 yet. My NIBs (cause they use some open source IB Pallets that haven&#8217;t been upgraded to IB 3 yet, and who even knows how ready IB3 is for such things) don&#8217;t open in IB3 so it&#8217;d be really awkward to do all the code in Xcode and reboot to 10.4 just to edit the NIBs.</p>

<p>Old IB used to be in the seeds. I don&#8217;t know where it went. :-(</p>

<p>Thanks again.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Hanson</title>
		<link>http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-1700</link>
		<dc:creator>Chris Hanson</dc:creator>
		<pubDate>Sat, 30 Jun 2007 04:54:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-1700</guid>
		<description>&lt;p&gt;You're sort of right that you have to use the "if" block to interact with a 10.y-only class from code that might run on 10.x (where y = x + 1; this has been true since Jaguar).  You actually need to use NSClassFromString to refer to the class itself as well:&lt;/p&gt;

&lt;p&gt;Class MyNSNewCoolClass = NSClassFromString(@"NSNewCoolClass");
  if (MyNSNewCoolClass != nil) {
    id coolInstance = [[MyNSNewCoolClass alloc] init];
  }&lt;/p&gt;

&lt;p&gt;Jonathan is right to suggest using a separate bundle; this is required if you want to subclass 10.y classes.&lt;/p&gt;

&lt;p&gt;There's one correction I'd like to make though.  When you build against an SDK, that SDK defines which version of the Mac OS X APIs you're building against.  There's a separate build setting - the Mac OS X Deployment Target - that defines the earliest version of Mac OS X that you want your code to run on.  This causes any global symbols (functions, global variables like notification names, etc. - sadly not classes though) introduced with a later version of Mac OS X to be weak-linked and automatically nil when run on an earlier OS.&lt;/p&gt;

&lt;p&gt;Thus you can write an application that runs on Mac OS X 10.3 but uses 10.4 API when present by doing the following:&lt;/p&gt;

&lt;p&gt;(1) Building the application against the Mac OS X 10.4u SDK, because that's the version of the API you want to use.&lt;/p&gt;

&lt;p&gt;(2) Setting the application's Mac OS X Deployment Target to 10.3, because that's the minimum system you want it to run on.&lt;/p&gt;

&lt;p&gt;(3) Checking that any functions or global symbols introduced in 10.4 are nil before using them.&lt;/p&gt;

&lt;p&gt;(4) Using NSClassFromString as above to interact with classes introduced in 10.4.&lt;/p&gt;

&lt;p&gt;(5) Using a separate bundle to subclass 10.4 classes.&lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You&#8217;re sort of right that you have to use the &#8220;if&#8221; block to interact with a 10.y-only class from code that might run on 10.x (where y = x + 1; this has been true since Jaguar).  You actually need to use NSClassFromString to refer to the class itself as well:</p>

<p>Class MyNSNewCoolClass = NSClassFromString(@&#8221;NSNewCoolClass&#8221;);
  if (MyNSNewCoolClass != nil) {
    id coolInstance = [[MyNSNewCoolClass alloc] init];
  }</p>

<p>Jonathan is right to suggest using a separate bundle; this is required if you want to subclass 10.y classes.</p>

<p>There&#8217;s one correction I&#8217;d like to make though.  When you build against an SDK, that SDK defines which version of the Mac OS X APIs you&#8217;re building against.  There&#8217;s a separate build setting - the Mac OS X Deployment Target - that defines the earliest version of Mac OS X that you want your code to run on.  This causes any global symbols (functions, global variables like notification names, etc. - sadly not classes though) introduced with a later version of Mac OS X to be weak-linked and automatically nil when run on an earlier OS.</p>

<p>Thus you can write an application that runs on Mac OS X 10.3 but uses 10.4 API when present by doing the following:</p>

<p>(1) Building the application against the Mac OS X 10.4u SDK, because that&#8217;s the version of the API you want to use.</p>

<p>(2) Setting the application&#8217;s Mac OS X Deployment Target to 10.3, because that&#8217;s the minimum system you want it to run on.</p>

<p>(3) Checking that any functions or global symbols introduced in 10.4 are nil before using them.</p>

<p>(4) Using NSClassFromString as above to interact with classes introduced in 10.4.</p>

<p>(5) Using a separate bundle to subclass 10.4 classes.</p>

<p>Hope this helps!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wight</title>
		<link>http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-1699</link>
		<dc:creator>Jonathan Wight</dc:creator>
		<pubDate>Sat, 30 Jun 2007 04:02:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.clickablebliss.com/2007/06/29/cocoa-code-branching-per-release/#comment-1699</guid>
		<description>&lt;p&gt;Compile your main code for 10.4.&lt;/p&gt;

&lt;p&gt;Put 10.5 specific code into a loadable bundle...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Compile your main code for 10.4.</p>

<p>Put 10.5 specific code into a loadable bundle&#8230;</p>]]></content:encoded>
	</item>
</channel>
</rss>
