<?xml version="1.0" encoding="UTF-8"?>
<post>
  <author>Simon Schoeters</author>
  <content>&lt;p&gt;The System Preferences application on Mac is universal since Snow Leopard: it can run in 32-bit or 64-bit but not at the same time. That's why you have to restart the application when you want to open an older Preference Pane.&lt;/p&gt;

&lt;p&gt;Today I tried to upgrade the &lt;a href="http://milkcarton.be/apps/lazypoken" title="A poken automounter" class="ext"&gt;LazyPoken&lt;/a&gt; prefpane as it was still a 32-bit build and the next Mac OS X will probably no longer support the 32-bit System Preferences application. That turned out to be a little harder as expected.&lt;/p&gt;

&lt;h3&gt;Build settings&lt;/h3&gt;

&lt;p&gt;First of all you should change your project ARCH flags to tell the gcc compiler it should build for 64-bit. You can do this in Project &amp;rarr; Edit Project Settings, choose the Build tab and look for the Architectures or ARCHS parameter. Choose the 64-bit or Universal mode (if you need to support Tiger).&lt;/p&gt;

&lt;p&gt;This is not enough however. If you try to build and install your application you&amp;apos;ll notice it&amp;apos;s still running in 32-bit, stubborn prefpane.&lt;/p&gt;

&lt;p&gt;The 64-bit System Preferences application also uses garbage collection and all 64-bit prefpanes need to support this as well. You can enable this in the same build panel under the Objective-C Garbage Collection or GCC_ENABLE_OBJC_GC parameter. Choose the Supported or Required option, again, depending on what you want to support.&lt;/p&gt;

&lt;p&gt;Clean and build your application again, check for warnings and try it out. Looking better now?&lt;/p&gt;

&lt;h3&gt;64-bit gotchas&lt;/h3&gt;

&lt;ul&gt;
	&lt;li&gt;Sparkle: make sure to include the With Garbage Collection version of Sparkle, you just activated garbage collection remember?&lt;/li&gt;
	&lt;li&gt;Older frameworks: make sure the frameworks your application depends on compile in 64-bit mode. The Developer Tools installed with Xcode include a tool to check your code for possible 64-bit incompatibilities. Read the &lt;a href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Cocoa64BitGuide/ConvertingExistingApp/ConvertingExistingApp.html#//apple_ref/doc/uid/TP40004247-CH5-SW1" title="64-bit Trasition Guide for Cocoa" class="ext"&gt;Converting an Existing Application to 64-Bit&lt;/a&gt; documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still running into problems? Read the &lt;a href="http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/PreferencePanes/Articles/UpdatingPreferencePanesforSnowLeopardandBeyond.html" title="Updating Preference Panes for Snow Leopard and Beyond" class="ext"&gt;Updating Preference Panes for Snow Leopard and Beyond&lt;/a&gt; article from Apple&amp;apos;s Preference Pane Programming Guide.&lt;/p&gt;</content>
  <created-at type="datetime">2010-02-04T00:06:36+01:00</created-at>
  <id type="integer">66</id>
  <location-id type="integer">8</location-id>
  <permalink>building-64bit-prefpane</permalink>
  <title>Building a 64-bit prefpane</title>
  <updated-at type="datetime">2010-02-04T00:15:10+01:00</updated-at>
</post>
