Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Interfce Builder changes files on open, causing SCM to report it as modified

Anyone have a problem with Xcode's IB showing xib files as modified just by opening them? Although in reality there were no modifications?

If I just want to look at a xib file's UI, this action makes Xcode show the file as modified, and then I have to discard changes and a lot of other things.

Any ideas?

like image 563
Kalamantina Avatar asked Nov 12 '12 14:11

Kalamantina


1 Answers

This will typically occur if you open a .xib file which has been generated/used by a previous version of Xcode.

This can happen for a variety of reasons. For example, with newer versions of Xcode, it will update the Interface Builder version number contained within the .xib with the one you're using. Other examples include differences in classes used to build the UI from a xib. It's undocumented what it's doing, but have a look at the diff to see for yourself.

Ultimately this is a problem with Xcode, and isn't really easily resolved. You can either:

  1. Commit the modifications, although this may pollute your diff. Unless your team are running older versions of Xcode than you, this shouldn't cause an issue. (If they are, make sure you're all on the latest/same version).
  2. Keep resetting the changes made to the xib file, or selectively choose not to commit the file.
like image 136
WDUK Avatar answered Apr 28 '23 13:04

WDUK