3

I have an Xcode4 (4.1 on Lion) iOS project that has a XIB file and corresponding .h and .m files. Call it myViewController.xib.

The file does nothing and I want to delete it. However, if I do delete it from within Xcode I cannot compile the project anymore. I get the error that interface builder could not open the file.

I checked every other file in the project. There is no other reference to "myViewController" anywhere that I can find in the project. I did a project search and nothing showed. A Spotlight search shows no files containing "myViewController"

If I just remove the reference to the files and leave the files on the drive, the project won't compile. This happened under Xcode 4.02 and Snow Leopard also so I know Lion is not to blame.

I tried moving the project to another computer and it won't compile there with the same error even though the "myViewController" file is there. I can show in finder and see the file!

Anybody have any ideas? I'm plum out of them.

TJ Asher
  • 737
  • 9
  • 27
  • Is it absolutely necessary to delete it? – please delete me Jul 25 '11 at 19:04
  • Yes. The file is a dead file. – TJ Asher Jul 25 '11 at 19:07
  • 4
    Just solved my problem! I kept digging around and discovered in the build phases section of the app target there was a reference to the XIB file in the Copy Bundle Resources section. I deleted the reference and viola! the app builds as expected on both machines. – TJ Asher Jul 25 '11 at 19:10
  • I was having this same problem and found that there was an entry under build phases that was red with the text "Missing". I had moved a file and the new location had already been added, but the old one wasn't removed. Nowhere else in xcode did it say there was something missing, but I got this same error when trying to build. Thanks @TJAsher I would have never found this! +2 – javajavajavajavajava Jun 22 '12 at 16:18

0 Answers0