Xcode4 nib file corruption

I have a rather strange problem that I still cannot understand so far, and I want to document it here because I have not seen this issue discussed elsewhere.

I have an iPhone app that I was developing for Xcode3. This worked fine, and I made a proposal package that worked great on devices.

Then I upgraded to Xcode4, and the next time I made a proposal, my application crashed on launch. It goes without saying that it worked in a simulator and in devices connected to my development machine. The alarm logs were not very useful, they indicated a failure in main.m, in a standard UIApplication call. Of course, I never changed this file. After repeatedly digging and assembling, I found a problem.

Xcode thought that the file type of my * .xib files was text.xml instead of file.xib and therefore only copied these files into the application package, not compiled them. After that, the application crashed at startup, because the MainWindow.nib file could not be found.

Looking through my subversion checks, I found that the file types recorded in the project.pbxproj file in xcodeproj changed in the first check after updating Xcode4. I have no idea how and why this happened. I also do not see in the user interface how I would influence this setting, and I did not even open part of the changed xib. (To fix my problem, I changed the pbxproj file in a text editor).

So, does anyone have an idea of ​​how and why this could happen?

+4
source share
2 answers

I am facing the same issue with my existing xcode3 projects that I migrated to xcode4.

I tried the @jaylinn solution, but I also found that the file already had lastKnownReference.

I managed to solve this problem by deleting the .xib files from the project (only to remove the link) and then re-adding them to the project. It is a little pain, but it works.

Hope this helps. -Mike

+2
source

Here's what it found for us. XIB has been identified as "explictFileType", which does not appear to be recognized in Xcode 4.

Look for such a line in the project file (open with a text editor) ...

C9B10BEA11D9084800F10866 / * Record.xib * / = {isa = PBXFileReference; explicitFileType = file.xib; path = Record.xib; sourceTree = ""; };

And change it to that ...

C9B10BEA11D9084800F10866 / * Record.xib * / = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Record.xib; sourceTree = ""; };

0
source

Source: https://habr.com/ru/post/1346477/


All Articles