Xcode crashes on opening xib files
I have problems with xcode and can't open xib files. Everytime I click on the xib file, xcode crashes. This happens on t开发者_运维百科he xcode3.2 as well as the xcode4.
Is there anything I can do to it? I have un-installed and re-installed but still not working.
Any help would really be appreciable.
If it helps, I am using xcode4 and bought it from the app store.
My problem was custom fonts in XIB file. I had to install missing fonts on my computer and problem was solved.
The solution to this problem was to re-install my operating system. Basically, I had to re-install Lion and after that everything worked fine. I think the problem had something to do with some library files that were missing.
NOTE: If you have this problem then re-installing your OS might not be the only solution as easier solutions may present themselves. Some of the answers on this question could be of help and in other cases, a simple google or stackoverflow search could be of great aid. You could also try the Xcode mailing list. I would advice resorting to re-installing your OS only if you have tried 'everything' and no one is able to help, hence your plan-Z.
I had this same problem in Xcode 4.3 today. It is definitely a bug in Xcode and it has something to do with opening xib files saved with older versions of Xcode. To work around it, I did the following, some of which may not be necessary, but I'll list it all here just in case:
- quit Xcode
- copied my xib file foo.xib to foo2.xib
- svn rm foo.xib
- svn commit
- svn update (now foo.xib is not on disk)
- open my xcode project, foo.xib shows up in red since it can't find the file. delete foo.xib from the project.
- drag foo2.xib from the finder into my project
- click on foo2.xib -- for me it opened just fine
At this point I'm pretty sure it's either a subversion conflict with xcode or xcode is keeping a stale reference to a filename around. But now that I have the file open, I do the following:
- Show the right-hand-side IDE settings pane (where you can set NIB options).
- Click the top left icon in the right-pane (tooltip says "Show the File Inspector").
- There is a section called "Interface Builder Document" and under there is a "Document Versioning" popup/combo box. My file shows Xcode 4.2.1, so I changed it to Xcode 4.3.
- At this point I also fiddled with a few other settings in my nib, for example changing the title of a Window. The point of this was to make sure the nib would be re-saved.
- Now in the left-hand pane that lists the project files, I clicked on "foo2.xib" and renamed it to "foo.xib" -- Xcode automatically adds it back to the subversion repository.
And everything just magically worked after that.
I will point out that I went through and changed all of my nib files after that to save as "Xcode 4.3" under the Document Versioning pane.
I sent a crash report and the nib contents to apple in a bug report but if anyone wants to see what actually happened I pasted it here:
http://pastebin.com/sC0pBUfu
I hope this helps someone, it took me about four hours to sort this out. Recreating nib files doesn't work, its a problem with the filename and IDE-version saved into the nib file I suspect.
Just Install one xcode at a time. Means use Xcode 4 or Xcode 3.2 alone. This may solve your problem. Try that.
Edited with new suggestion from http://www.cocoabuilder.com/archive/xcode/305032-xcode-help.html :
If you have entirely uninstalled and then reinstalled XCode, and by uninstalled I mean running
sudo /Developer/Library/uninstall-devtools -mode=all
and then trashing /Developer and then reinstalled and it's STILL not working then from the error I have to think you have a corrupted OSX or a stray library.
I googled and found a couple of people who succeeded by reinstalled SnowLeopard (and then upgrading it all the way to latest patch level, then reinstalling XCode), and there were a few people who had found stray libraries in /usr/local/include and /usr/local/lib, so you might want to go look for odd files there, or perhaps TEMPORARILY rename them and try reinstalling XCode, I'm not sure how much of what's in there you really need. The particular post I found they guy had installed ImageMagic and he had removed those libraries from /usr/local/lib and was working again.
At this point I'd be looking beyond XCode itself and assuming my system was corrupt.
There's more suggestions on Google, just put in CFXMLNodeGetInfoPtr and there are loads of posts, more asking than answering.
and Don't use the App Store version. Use the one on Apple.com/Developer for iOS SDK's.
Create a new XIB. Click once. If not:
Don't just open the xib, right click Open As : Source. See if you can see anything, if it still crashes: Does not seem to a Xcode.pbxproject error
Well, one way can be..:
type interface builder in spotlight
open it.
go to your project and drag & drop your xib to the interface builder on the dock.
It will open.
This problem may be because of multiple versions of xcode on different locations on your mac.
Can't open any xib file for iOS? In your crash log,
Details: Interface Builder encountered an error communicating with the iOS Simulator. "Interface Builder Cocoa Touch Tool" (5963) failed to launch and exited with status (null), signal 5. Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Have you checked your console log using Console.app? Anyway, it sounds like that your Xcode environment is corrupted.
- sudo /Developer/Library/uninstall-devtools -mode=all
- If you put any files into /Developer, back it up.
- sudo rm -rf /Developer
- reboot.
- install Xcode.
Its an XCode
bug.
Creating a new .storyboard and opening it before opening .xib will fix the crash, at least temporarily.
精彩评论