10

Since I upgraded to Xcode 4.5 I've found that it's automatically removing a section of each xib file I visit. Here is the section:

<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
        <real value="1536" key="NS.object.0"/>
</object>

I can almost live with this, but when I go visit the file again I find there are even more 'auto' changes. They are more varied and harder to characterize so I won't include examples unless I really need to.

I don't understand what's going on here. I'm looking for one of two answers:

  1. Is there some way to disable this?
  2. Why is this happening and is there some way to force Xcode to apply these changes to all xib files so I can be done with this?

I would feel a lot better if I just understood what the heck is going on and why.

Rob Jones
  • 4,925
  • 3
  • 32
  • 39
  • I am seeing similar behaviour where by the xib becomes edited after cvs submit causing the file to try to unlock for some reason. I am interested in finding a way to disable this – damien murphy. Nov 05 '12 at 16:22
  • 1
    Hmmm, I don't think this issue has been around that long. I keep Xcode fairly up to date. This is a pretty recent development. Nevertheless, duration is not relevant. It's annoying no matter how long it's been going on. – Rob Jones Nov 07 '12 at 03:20
  • Yes, it's driving me crazy... the XIB format tracks far too much info about class properties - so when you add/remove unrelated code, the XIBs get updated. – antsyawn Nov 16 '12 at 06:08

2 Answers2

0

From what I've seen of this, Xcode will automatically reformat nibs, adding/removing from the .xib files as needed. Nothing seems to be functionally different for my purposes when I've had this happen.

Just for SEO, I'll bring this up, as this is very relevant when tracking changes in version control, such as Git. Every time I open old .xib files in Xcode (I'm using 5.0), they are automatically changed and it shows up in my Git client's diff tool.

TRY THIS:

*(If you are not using Git or some version control, set up a repo for the project to test this.)

  1. See if there are any remaining unmodified .xibs you can open without modifying them.

  2. Select/View it, but don't change anything.

  3. Now select/view a different file in the project navigator. If an "M" shows up next to the .xib, rebuild your project and verify that it's behavior is the same.

If you want to ignore these, for version control reasons, just be sure not to stage/commit them if you're not intentionally making any changes to them.

If you want to "undo" the automatically changed file(s):

  1. Right click on the file in the project navigator.
  2. Go to "Source Control" >>> "Discard Changes..."

OR, discard them via Git or your version control tool of choice.

Old McStopher
  • 6,295
  • 10
  • 60
  • 89
0

there is a way to disable this, but it is not without its own problems (listed below). You can show the xib file in Finder, Get Info on the file, and then under General, select Locked.

Problem 1: If you use source control, like most people, you won't be able to checkout an earlier commit or reset your branch to an earlier commit, until you unlock all the files that will be changed by the operation.

Problem 2: Now, every time you view the file in IB, a popup slides down from the top of the xCode window, with the title
“MBPreDeliveryComplete.xib” is locked for editing and you may not be able to save your changes. Do you want to unlock it?

And this message:
“MBPreDeliveryComplete.xib” is currently locked because it is marked as ‘Locked’ in the Finder.

With buttons giving the option of unlocking or not unlocking the file. Of course you can elect not to unlock the file, unless you actually intend to make changes.

Sheamus
  • 6,506
  • 3
  • 35
  • 61