Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I click on the XIB via the project navigator. It opens up and immediately changes the icon to gray showing I have unsaved changes. If I save changes, click on a different file and click back to re-open it, more changes. Always modifies on open.

It happens with one XIB file in this project and a couple in another project. I'd love to know why it's happening and what I can do to fix it now and prevent it in the future.

Note: using Xcode 3.2 Build 4C199 with Snow Leopard

Edit: I've added a couple sections which got removed from the XML on one of these open/modifications

        <key>outlets</key>         <dict>             <key>addEventTabBarController</key>             <string>UITabBarController</string>             <key>window</key>             <string>UIWindow</string>         </dict>         <key>superclass</key>         <string>NSObject</string> 

and

        <key>outlets</key>         <dict>             <key>courseTableCell</key>             <string>UITableViewCell</string>         </dict>         <key>superclass</key>         <string>UITableViewController</string> 
like image 918
DBD Avatar asked Nov 04 '11 00:11

DBD


People also ask

What is better XIB or storyboard?

Storyboards - this is a visual tool for laying out multiple application views and the transitions between them (segues). XIBs (or NIBs) - each XIB file corresponds to a single view element and can be laid out in the Interface Builder, making it a visual tool as well.

Which data format do XIB files use?

Application interface created with Interface Builder, a graphical editor for designing and testing user interfaces; saved in a text-based flat-file format, introduced in Interface Builder 3.0. NOTE: XIB files are also called "development-time format" files.


1 Answers

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.

like image 109
DBD Avatar answered Oct 02 '22 07:10

DBD