Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Includes .xib files that have been deleted!

Tags:

xcode

iphone

I have a problem with Xcode that I can't seem to resolve. I have a view controller lets call "foobarViewController", there was a "foobarViewController.xib" to accompany it. In this controller I splish-splashed with the view to make it look the way I wanted, but decided to do it pragmatically. And so I deleted the xib from the project, cleaned all targets, restarted xcode, restarted COMPUTER, deleted the old build folder even and STILL when I compile the view includes objects that were only in the XIB file.

What is going on here?

like image 596
Parad0x13 Avatar asked Feb 12 '11 20:02

Parad0x13


6 Answers

Try these 3 things:

  • Delete app from simulator

From Xcode:

  • Build Menu -> Clean All Targets -> Check both boxes -> Clean
  • XCode Menu -> Empty Caches... -> Empty
like image 120
Jonathan. Avatar answered Nov 20 '22 19:11

Jonathan.


Did you delete the app from the simulator? When Xcode installs a development build, either in the Simulator or on the device, it doesn't delete existing files. It simply overwrites files and adds new files. This means that if you delete a file from Xcode, it will be left in the already-installed built product. The solution is to delete the product from your simulator/device before installing.

like image 45
Lily Ballard Avatar answered Nov 20 '22 19:11

Lily Ballard


Are you sure it was deleted? You may have only removed the reference to it. Open the project folder and make sure it isn't there. Better yet, do a search in spotlight for the filename.

If you can't find the file, it's still unresolvable, and you made the view controller programmatically, try pasting your code into a text editor, delete the classes, and re-make it and paste the code back in.

like image 30
TigerCoding Avatar answered Nov 20 '22 18:11

TigerCoding


The AppDelegate load the MainWindow.xib, and in the MainWindow, it include your foobarViewController.xib, therefore your problem occurs. Try editing MainWindow, point it to your controller class instead of including the xib.

like image 29
howanghk Avatar answered Nov 20 '22 18:11

howanghk


check out this post: How to Empty Caches and Clean All Targets Xcode 4

"Command-Option-Shift-K to clean out the build folder. Even better, quit Xcode and clean out Library/Developer/Xcode/DerivedData manually. Remove all its contents because there's a bug where Xcode will run an old version of your project that's in there somewhere.

In the simulator, choose iOS Simulator > Reset Content and Settings.

Finally, for completeness, you can delete the contents of /var/folders; some caching happens there too." - Matt

like image 3
Tieme Avatar answered Nov 20 '22 19:11

Tieme


In XCode4, Command-Option-Shift-K should do the job. Same as product, press the option key, now the option "Clean" will change to "Clean Build Folder ..." select that option.

like image 2
sram Avatar answered Nov 20 '22 19:11

sram