Chapter 8 is now obsolete in xcode 4.5


#1

[UPDATE: Oct 9, 2012] OK, the chapter is not so obsolete if you turn off ‘Use Autolayout’ for the view - see the second post below.

After updating to xCode 4.5, the concept of an autosizing inspector shown in Figure 8 appears go be gone. when I select the view or any of the buttons, imageview or horizontal slider post xCode 4.5 upgrade there is no longer an autosizing size inspector in the ‘Show the Size Inspector’ tab.

There appears to be a whole new paradigm for dealing with what happens when views rotate. Each time I added a subview to the main view new ‘Constraints’ shows up with purple icons in the Objects window. It appears that through these the developer is to control what happens when a view is rotated. I spent a few minutes with them but couldn’t find any obvious way to replicate what was going on in the remainder of chapter 8. When i run the Heavy Rotation App the image view doesn’t re-size. It scrolls past the end of the page and the buttons underneath are gone. My slider does stay at the top and adjust to be the full width of the landscape screen.

It would seem that I need to add a new vertical constraint somehow to make sure the image view stays centered above the bottom. But i can’t see how toa dd a new constraint beyond those created automatically.

I know that the authors just put out an update to the changed book page in .pdf form:

viewtopic.php?f=136&t=5251

but the issues arising from these changes are not dealt with there.

I would post images on the changes but near as I can tell there is no way to upload images to this forum.

Onwards to Chapter 9 I guess.
…Dale


#2

OK, this chapter is not so obsolete any more. All you need to do is turn off AutoLayout for the view.

Select the view, then click in the "show the x inspector’. then UNCHECK the ‘Use Autolayout’ feature available in xCode 4.5 and iOS 6.

Once you do that the struts and springs are back.

See the second image in this article:

raywenderlich.com/20881/begi … art-1-of-2

[Update Oct 11, 2012: I completed chapter 8 and all was fine. I then used the tutorial linked above and learned the ‘constraints’ method used in iOS 6. I STRONGLY recommend this ‘Constraints’ tutorial to you. It shows the limitations of the struts and springs approach and describes all you need to know for the bold new world of ‘Constraints’. I wish ‘Constriants’ were backwards compatible to iOS 5 because they certainly are more useful and, frankly, once you understand them, easy to use.]

…Dale


#3

Thanks for this link Dale. It was very helpful and I am ready to tackle chapter 8. :smiley:

John.


#4

I am completely lost. I have run the tutorial in the link and i get totally different results to what the tutorial predicts every time. It looks like the dimension of the view in the tutorial is different to what is in my simulator. I am really struggling to get my head around learning iOS programming when every bit of text and tutorial I can find is out of date with where the software is.