Apple PrefPane example fails to build with clang error objecting to both -fobjc-arc and -fobjc-gc
automatic-ref-counting, clang, garbage-collection, osx-lion, xcode4
Solution
I just stumbled upon this myself. So turns out (accoridng to Apple dev docs):
All 64-bit preference panes are expected to use garbage collection. Using garbage collection will, in most cases, simplify your code and reduce the likelihood of memory leaks.
In Snow Leopard, the System Preferences application will run 64-bit preference panes with garbage collection enabled, and 32-bit panes with garbage collection disabled.
For more info go to Updating Preference Panes for Snow Leopard and Beyond.
So you can't use ARC. Only GC.
Problem
I'm trying to build a preference pane as a part of learning OS X development. After downloading Apple's preference pane example code and trying to build the project I get the following error: clang: error: cannot specify both '-fobjc-arc' and '-fobjc-gc' Turning off garbage collection in Build Settings allows the project to build properly, but once the preference pane example is installed on the local machine it won't start saying, "You can’t open PrefsPane preferences because it doesn’t work on an Intel-based Mac." I've tried every combination of architecture (10.6, 10.7) and Objective-C Automatic Reference Counting (Yes, No) and Objective-C Garbage Collection (Supported (-fobjc-gc), Unsupported, Required (-fobjc-gc only) available. While some combinations do allow the project to build, I can't get the preference pane to load. What are the proper architecture, ARC, and GC settings necessary to build and deploy a preference pane for OS X 10.7 using Xcode 4.3.2?