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?
Try these 3 things:
From Xcode:
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.
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.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With