41

I am using Xcode 5 developer preview. When I change or add a in the XIB file from interface builder Xcode shows this warning:

Frame for Button will be different at run time.

How do I remove this warning?

André Dion
  • 21,269
  • 7
  • 56
  • 60
sohail059
  • 830
  • 1
  • 6
  • 14
  • WWDC 2013 session 406: "Taking Control of Auto Layout in Xcode 5" https://developer.apple.com/wwdc/videos/ Learn the AutoLayout. – NIX Oct 06 '13 at 16:17
  • In my case it was something with the storyboard that must have been corrupted. Cutting (CMD-X) from the storyboard the object (a collection cell) and pasting it back (CMD-V) fixed it. I waste hours redoing all the constraints before that... – Michele Dall'Agata Aug 07 '18 at 08:41

2 Answers2

128

This warning is displayed when the actual position of the element is different in your storyboard than while running the app.

You can select that element and then hit Option+Cmd+=.

This will update the position of the element in the storyboard and that warning will go away.

You can also find this option in menu under Editor > Resolve Auto Layout Issues > Update Frames.

Bilbo Baggins
  • 3,644
  • 8
  • 40
  • 64
33

Probably you have created a conflict in constraints. To resolve it Open nib file Go to editor > Resolve all constraint issues> from there you can reset all/desired constraints.

abdus.me
  • 1,819
  • 22
  • 34
  • 6
    Don't remove your constraints, fix them instead, see [Enrico's answer on SO](http://stackoverflow.com/a/21199044/1693173) – progrmr Sep 23 '14 at 14:09
  • 1
    As of Xcode Version 6.4 (6E35b), I've found "Resolve all constraint issues" to cause more problems and re-break things I've fixed, Bart's (http://stackoverflow.com/users/461844/bart-simpson) solution below worked for me. – RayInNoIL Aug 27 '15 at 18:02