Xcode Source Compiling Order Issue
Xcode Source Compiling Order Issue
- Subject: Xcode Source Compiling Order Issue
- From: Trygve Inda <email@hidden>
- Date: Mon, 25 Apr 2016 11:46:19 -0700
- Thread-topic: Xcode Source Compiling Order Issue
My product is a System Preferences Pane. Its principal class is MyPrefPane
and is defined correctly in the Info.plist file under NSPrincipalClass.
The bug I am seeing happens when trying to install a new version over the
top of an older one if (and only if) System Preferences is closed or System
Preferences is open but the older pane has not been clicked on (and is thus
not loaded).
I get an error that my pref pane can't run on an Intel Mac and console
reports:
System Preferences[10232]: -[MyMinorClass initWithBundle:]: unrecognized
selector sent to instance 0x7fc60be96170
System Preferences[10232]: [NSPrefPaneBundle instantiatePrefPaneObject]:
error occurred during instantiation.
It seems like System Preferences is trying to init my pref pane by loading a
minor internal class instead of my MyPrefPane class.
In Xcode Build Phases under compile sources, I noticed that the first two
items are:
MyMinorClass.m
MyPrefPane.m
If I reverse these, and compile MyPrefPane.m first, the bug is eliminated.
Putting any other class before MyPrefPane.m results in System Preferences
making the same attempt to call the first-compiled class with
initWithBundle:
Why does the compile order matter?
I found a similar issue here:
http://stackoverflow.com/questions/31373144/xcode-source-compiling-order-iss
ue
He solved it by rebuilding the project. I have just spent 8 hours rebuilding
this complex project and still get the same results as before (this Xcode
project has existed since Xcode 3)
I am unable to reproduce this on a simple Xcode PrefPane template.
Any ideas?
I am not sure if this is an Xcode issue or something in the OS. For now of
course all I can do is make sure the principal class is compiled first.
Trygve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden