2

I have a production app that has been working fine when built with Xcode5. The app runs fine in production under iOS8.

When building with xcode6, something strange is happening. Based on user selections, I set the position of several UILabels and UIImages through a call to a method, using this code as an example:

    CGRect frame1 = _lblRedJudge1Score.frame;
    frame1.origin.x = 253;
    frame1.origin.y = 610;
    frame1.size.width = 25;
    frame1.size.height = 25;
    _lblRedJudge1Score.frame = frame1;
    _imageRedJudge1Score.frame = frame1;

The method correctly sets the position of _lblRedJudge1Score and _imageRedJude1Score. Then, any user interaction on the view, such as a button press, causes the position setting to go back to the locations shown on the StoryBoard. This does not happen in earlier version of Xcode.

It's as if, the view is reset and forgets the position settings I set above. It appears that the UIView gets re-written/updated based on StoryBoard settings and loses the programmatic settings I call in the method.

Note: the label and image objects are define in the .h file as strong, nonatomic. Neither object has any contraints in the view. The method used to set the position is ONLY called once.

Is this a new feature that I don't understand and will need to update code for, or is this a bug in xcode6? This issues shows up in both the simulator and actual devices.

SteveM
  • 347
  • 1
  • 5
  • 17

1 Answers1

2
layoutSubview 

Does not get called anymore. That might be your issue. Check this out.

Community
  • 1
  • 1
Michal Shatz
  • 1,416
  • 2
  • 20
  • 31