Xcode: Interface Builder XIB Compiler Error

后端 未结 4 1418
庸人自扰
庸人自扰 2021-01-19 09:05

Xcode 5.1.1 and OS X 10.9.3

I open Xcode and start a new Cocoa project. I then click run. The build fails, and I get the following error message:

Int         


        
相关标签:
4条回答
  • 2021-01-19 09:09

    I got a similar error with a brand new project when I had a special character (&) in the Organization Name. The OP doesn't seem to have this situation, but maybe this will help others who find their way here. This seems to be a new bug with Xcode 6.

    0 讨论(0)
  • 2021-01-19 09:23

    Aha! What a ridiculous solution! Hope this helps somebody.

    Add a new xib file!

    And delete the old MainMenu.xib for good measure. The new xib will show up as expected.

    enter image description here

    But wait - there's more!

    I'm not sure if it's just that my Xcode is horribly corrupted, but here's what else I had to do to get my application to run successfully:

    1 - Go to your general project settings and set the Main Interface to your new xib file's name without the .xib extension! Otherwise, you'll get output in your console that says Unable to load nib file. See pics to compare. This will get your blank app window to pop up when you run the program.

    enter image description here enter image description here

    2 - Now you need your app delegate to do stuff. Drag an Object from the object library to the list of objects in the interface builder. Define its class as your app delegate class name and the object should rename itself to 'App Delegate'.

    enter image description here

    3 - control drag from Application to App Delegate and select 'delegate'. Now your app delegate code will work.

    4 - Add a NSLog(@"app success!"); statement in the applicationDidFinishLaunching method to confirm you did everything correctly, hit run, watch the window pop up and the NSLog output into the console, and congratulate yourself for making an Apple product work the way it should have been designed to work.

    0 讨论(0)
  • 2021-01-19 09:32

    I fixed the problem by opening "Xcode-Macintosh HD" instead of "Xcode- Developer" after searching it from spotlight. (Spotlight is the magnifying glass in the top right)

    0 讨论(0)
  • 2021-01-19 09:33

    I have solved this problem by removing duplicate reference from project settings -> build phases -> copy bundle references

    0 讨论(0)
提交回复
热议问题