Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In xcode 6.1, interface builder deleting ui elements

I have a view with some tableviews and some collection views and also some buttons and labels.

I'm not sure if this is new with Xcode 6.1 because I have not worked on the ui aspect of this project for some time. However, when I try to resize just about anything in the view, my tableviews and collection views, and possibly some other elements I am not noticing, get deleted. Specifically, it seems their frame or rect propertied get deleted.

To be clear, this only occurs when I attempt to resize the element by dragging the sides in interface builder. If I resize them by changing the numbers directly either in the IB sidebar or in the xml, this does not happen.

I'm wondering if this is a bug in Xcode or if I have done something to cause this behavior which I can change.

Thanks!

like image 615
Mason Avatar asked Oct 23 '14 20:10

Mason


3 Answers

I acheived a fix, at least for this project by turning off auto layout in "show the file inspector" -> "interface builder document"

I have never used this feature in the past so I do not know if it was on in the past but I am wondering if the new Xcode version turns it on by default where the others left it off. It may also be possible that it has always been on but there is a bug in the feature in the new version.

This fixed the issue for me, at least in this particular project and at least for now. I hope others find this useful.

like image 126
Mason Avatar answered Oct 19 '22 15:10

Mason


From here it looks like a bug in Xcode 6.1.

I created a clean project and the behaviour is the same on my machine:

https://github.com/nasht/Xcode6ConstraintTest.git

Resizing one view makes others disappear. Changing a layout constraint from a = to <= or >= also seems to do it.

I've raised a bug with Apple. Suggest you do the same.

workaround: You can install xcode 6.01 and use interface builder from there. You can still compile and run your code using xcode 6.1 if you're relying on xcode 6.1 specific features. (you'll need to rename your xcode.app so you can run both instances. ) It's ugly, but it works.

like image 31
Nash Avatar answered Oct 19 '22 17:10

Nash


same problem, yosemit and xocde 6.1. I can resize some view only if i disable autolayout.

like image 29
IgnazioC Avatar answered Oct 19 '22 15:10

IgnazioC