Quiz App - Labels and buttons change position


When I run the Quiz app in the simulator, my objects move. In the controller.xib, the labels and buttons are laid out evenly across the view. When I run the simulator, they move. Initially, the answer label was hidden completely behind the show answer button. I was able to reposition it in the .xib, in order to make it visible in the simulator, but the positioning still does not match.

I’m trying to access the springs and struts as detailed here stackoverflow.com/questions/1168 … eal-device

but when I click the size inspector, the view presented on the above url (the two rectangular boxes, one with sets of red arrows, and the other laid out on a mac background) flashes and disappears. Stranger still, that does not occur every time. I can toggle back and forth through the inspector selector, and that view will appear or not appear in seemingly random fashion upon clicking.



solved my own problem, more or less. In the .xib file, under the File Inspector Tab, listed under Interface Builder Document, is a selector labeled "use autolayout"
Unclicking that selector fixed my problem which I believe was caused by a difference between the simulation screen size and the screen size assumed in the .xib file.

very annoying


Had the exact same issue. That Auto-layout just does it’s own thing. So I turned it off.


Thanks for posting this question and solution! This is worthy of inclusion in the book somehow, I spent 45 minutes trying to debug why setText on the answerField wasn’t working before I realized it was hidden behind the button by dumb luck. Somewhere in that 1st chapter it would have been very handy to read that the view editor isn’t necessarily WYSIWYG.