0

I am following a tutorial on how to add iADS to an app. This tutorial is pretty good since it accounts for iOS 3.0+. It can be found here http://www.raywenderlich.com/1371/how-to-integrate-iad-into-your-iphone-app

Now in the tutorial, one of the steps is the following:

"But there’s an easy way to fix it – we’ll simply move the controls into a subview instead! The easiest way to do this is to drag another view from the library into the XIB, and change its size to be the same as the existing view’s size (320×416). Then drag the existing view as a subview of the new view. When you’re done, it should look like the following:

enter image description here

Now my problem is when I add this new view (the sub view) to my current view, it does not expand into a hierarchy as shown in the picture until I select everything (images, labels, etc etc) and manually drag it into this new subview. This works BUT my positioning of labels, images etc etc has been lost. Everything is literally in the centre of the subview stacked on top of each other. I realize this tutorial was done in xcode 3 but is there something I can do to maintain position of my objects? I have many objects in the view and it would be such a pain to relocate them all again.

Thank you so much!

Teddy13
  • 3,824
  • 11
  • 42
  • 69
  • I believe that if you highlight objects, you can then copy and paste them. I have no idea if Xcode retains their positions, but it's worth a shot. – CodaFi Feb 09 '12 at 05:00
  • Works but I lose referencing outlets. Thanks though – Teddy13 Feb 09 '12 at 05:06

1 Answers1

1

You could take your existing original view and add it into another view making your original the subview. This should keep all the original view's subviews position the same.

Joel Kravets
  • 2,473
  • 19
  • 16
  • What do you mean exactly? And would this keep referencing outlets since I tried the copy and paste method but lost referencing outlets – Teddy13 Feb 09 '12 at 05:06
  • Judging from your picture above you add a subview to your original view and then moved all your items into the new subview. You could instead create a new view and then move your original view into the new one. – Joel Kravets Feb 09 '12 at 05:08