Reputation: 6644
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:
Interface Builder XIB Compiler Error
Interface Builder was unable to determine the type of "MainMenu.xib".
I also don't see the usual WYSIWYG editor when I select MainMenu.xib
just a black screen. I notice the "type" of file is "Default - Abstract Interface Builder File", whereas on other working projects I have built in the past, the "type" is "Default - Interface Builder File". Seems there's something about it being an "abstract" file that's causing Xcode to not display the interface builder.
I tried fully uninstalling Xcode and re-downloading it from the App Store. Didn't help. Multiple google searches have turned up nothing helpful, and the other Stack Overflow questions with a similar title to mine aren't illuminating. I can't imagine everyone else with Xcode 5.1 has this issue. Any experts out there that could suggest a quick fix?
Upvotes: 4
Views: 8491
Reputation: 109
I have solved this problem by removing duplicate reference from project settings -> build phases -> copy bundle references
Upvotes: 2
Reputation: 929
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.
Upvotes: 0
Reputation: 449
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)
Upvotes: 0
Reputation: 6644
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.
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.
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'.
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.
Upvotes: 2