Why is my XIB modified every time I open it in IB? Why is my XIB modified every time I open it in IB? ios ios

Why is my XIB modified every time I open it in IB?


I wound up submitting this issue to Apple. Their response was unenlightening, and talking about possible optimizations, updating meta data for new version of Xcode and the like.

I tracked 100 versions from clicking off and on the file. As Apple said, it was "optimizing" every time, but each time it simply moved some XML tags around. Never happy with it's own optimizations it moved them around the next time they were opened. I'd consider it a bug with Xcode, annoying, but mostly harmless.

This only happened with old XIBs and either moving the contents into a new XIB file or (what really happened) Storyboards got rid of the issue.


I did not want to use storyboards as suggested in one of the other answers.Here is an alternative simple/quick fix.

Go to the Interface Builder Document Properties on the inspector when selecting the xib view file.Then you need to

  • change "Deployment" to something different from Project SDK, in my case I set it to the latest iOS version (iOS 6 currently).
  • change the development to something different from "Previous version", in my case I set it to the latest Xcode version 4.5

I run Xcode 4.5.2 on Lion.

Hope this helps.


basic Idea...

XCode stores lots of version numbers of all different sorts of things. If you look at the XML representation of the XIB, you should find that the vast majority of these little changes are in these version numbers.

How it happens...

Whenever you do an update of Xcode, many different things within Xcode (and often inside the SDK) get updated. If you make a change to a XIB file, those version changes get stood in the XIB. So, if you happen to open a XIB file, the version changes get put into that file. As soon as you build or run the app, those changed get saved to the file.

But I haven't update Xcode in a while!

Well, whenever you did your last update, the XIB files will be updated with the new version numbers as you open them, one-by-one over time.