16

I've searched all over and haven't found any help...

I built a small test app with two UIViewControllers and their corresponding xibs. Things were fine, then I made some changes to both xibs but when I build and run, I get the old views. I've tried deleting the build folders, running in the simulator and device, cleaning all targets and still the same, old, broke-down xibs that I totally changed are still showing up. I've restarted all the Xcode apps and even my computer.

Getting pretty irritated!

EDIT: I never did figure out what the problem was. Basically, once I had built a project, it remembered the first xibs I made and wouldn't recognize changes to them. If I told a view controller to load from a different, valid nib name, it'd complain that the old one wasn't there.

I reinstalled Xcode and now it all works again. Sheesh.

Steve
  • 6,332
  • 11
  • 41
  • 53
  • Hi Steve, I have exactly the same. I run xCode 3.2 and work on an iOS4.2 app when this happens. –  Feb 18 '11 at 08:12
  • 2
    In case this happens to you again: http://stackoverflow.com/questions/5714372/how-to-empty-caches-and-clean-all-targets-xcode-4 – Ascendant Aug 10 '11 at 03:42

13 Answers13

13

Try deleting the app from the simulator (hold down on the app's icon to get to jiggle mode, then click the X by the app) and from your device. Then let Xcode reinstall it.

Graham Perks
  • 23,007
  • 8
  • 61
  • 83
  • I tried that several times. Actually, I had just modified my xibs and not really deleted them. I just did that and emptied the trash. Now I crash because Xcode can't find the xibs! Even though there are new ones with the same names and the same object types. `*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'FlashViewController''` – Steve Sep 22 '10 at 03:17
  • thanks, this fixed my problem where the old XIB was being displayed even after I'd deleted it through Xcode. – Dan J Sep 28 '10 at 19:52
  • Thank you, nailed it. Going around in circles, very confident there was no way my FlipsideViewController navigation bar should still appear after deleting the FlipSideViewController.xib file but it kept showing up. – Zhang Jul 20 '12 at 16:25
  • i tried every thing, then as said my somebody at top, i moved some object, and it worked. – Pawriwes Dec 31 '13 at 02:54
7

just clean the build using

Product -> Clean

menu.

Kjuly
  • 34,476
  • 22
  • 104
  • 118
Alon
  • 83
  • 1
  • 4
2

I just found (and fixed) a related problem — one that demonstrates similar symptoms but whose root cause is slightly different.

In particular, the symptoms I observed were that my iPad app would initially display an old storyboard image for the first page and, after a short delay, would bring up the most recently edited story board contents. I went through most of the above machinations to no avail.

The problem is that the iPad loader first just dumbly loads your app's launch image into the screen. You usually set up this image as part of the early administrative setup of the app in XCode. At launch time, while the end user is considering the content and cogitating about where to touch the screen, the application is in the mean time madly getting itself ready, un-archiving the xib/nib/storyboard, and doing the real work of getting ready.

In the ideal situation the provided launch image is pixel-for-pixel the same as the one generated by the nib-unarchiving-process. However, if you forgot to update your launch image after updating the story board, you'll see an image shift at the completion of the unarchiving.

I wouldn't have suspected this as the problem except that I had read Jef Raskin's description of how he did exactly this on the Canon Cat word processor to provide the illusion of an instantly ready application: it takes advantage of the fact that the typical human response time to an application startup is on the order of seven seconds — plenty of time for even a floppy-based system to load and overwrite the bitmap facade that the loader sets up. Sometimes, it's good to have read a bit of arcane history. Jef would of course later go on to found a project whose name was Macintosh, and the rest is history — and this bug.

Bot
  • 11,868
  • 11
  • 75
  • 131
  • You're my hero! Searched and tried everything for two days to get rid of this ghost image of an old screen showing up on app launch. Checked my launch images and there they were. Unbelievable. – JeffK May 08 '14 at 15:30
2

Just modify your XIB files a bit, then save them, xCode will detect a modification (last modified date in the file system) then load the xib from its actual path, and not from a cache-path :P

Sirius
  • 21
  • 1
1

Not sure whether this helps, but I just had this.

It took me days to work it out. In my case I enhanced an existing Xib file. The changes I applied in interface builder never appeared in the app.

Eventually I found the cause. I had my FilesOwner view outlet set to a subview below the top view. When I enhanced the view I did this as an extension to th top view. Thus the changes never appeared when running the app.

Changing the view outlet to the correct view ( the top view in my case ) did the trick and it all worked fine ...

1

I know steve has found a work around but the problem is not in the XIB files at all. Xcode does not update the YouApplication-info.plist file to

If you open it up you will see the line: Main nib file base name. You must change the value to reflect your desired NIB file name

PowerAktar
  • 2,341
  • 1
  • 21
  • 17
1

I had this problem, and it was a result of xcode continuing to copy previously compiled xib's - even though the source file was deleted, the build cache wasn't. Product > Clean and then recompiling solved it.

johna
  • 71
  • 1
  • 2
1

I just had this issue, just delete the app from the simulator.
Then do a clean on your project.
In xCode, go to the Product menu, select Clean.

Or just press Shift+Command+K!

Jim Hall
  • 6,079
  • 2
  • 16
  • 15
0

Just an assumption, not sure if that really caused it: I finished a XIB that worked fine in the simulator and on an actual device. I then changed it to be localised in Xcode 4.5.1. The changes I did after that were not synced to the device until I manually deleted the app from the device and reinstalled via Xcode.

domsom
  • 3,163
  • 1
  • 22
  • 27
0

I ended up recreating the xibs from scratch and that worked. Very frustrating.

Steve
  • 6,332
  • 11
  • 41
  • 53
0

Deleted derived data, cleaned project and build. Old xib was magically removed. :D

Iris Veriris
  • 448
  • 5
  • 7
0

you can try to modify your XIBs a bit, so xCode will detect a modification through the last modified date in file system. then it will load the xib from its actual path, an not from xCode cache.

Sirius
  • 21
  • 1
0

I had the same problem, but i solved it by changing the datetime of my system to today. And re-saved the xib. I was testing the local notification.

shaw kwok
  • 241
  • 5
  • 11