4

I have a project where I use two build settings predominantly. Unfortunately today something went wrong. One compiles and the other doesn't. How can I compare the two build settings in XCode to see what the differences are?

(For those interested, the error I get in one build is

jump to case label crosses initialization of 'const char* selectorName'

if you know what this means I'll be very grateful )

John Smith
  • 12,491
  • 18
  • 65
  • 111

3 Answers3

7

Your project configuration is stored in the directory (package) of:

YourAppName.xcodeproj

Open up terminal and cd into that directory. You'll find some .plist format files:

project.pbxproj username.pbxuser

You can do a diff on these files with your other project. But you probably have issues with your source code in reality. Do you have a switch case you are using? Do you declare any variables in the switch? If so, are you using brackets, {}?

Mike
  • 8,853
  • 3
  • 35
  • 44
3

You probably declare a variable inside a case without wrapping it all in a brace:

case foo:
    const char* selectorName;
    // ...
    break;

Should be:

case foo: {
    const char* selectorName;
    // ...
    break;
}
Mike Weller
  • 45,401
  • 15
  • 131
  • 151
1

In 2022 and Xcode 13 if it's a scenario with multiple targets within the same project you can just Shift + Click the targets you want to compare and enable Levels in the filter bar.

(see also https://mjtsai.com/blog/2019/02/01/comparing-xcode-target-build-settings/)

ATV
  • 4,116
  • 3
  • 23
  • 42