views:

35

answers:

2

Hello,

i'm trying to crete an App that works in potrait and landscape mode, with ONLY ONE ViewController. So i've 2 file XIB... how can i select one of them from the ViewController? I've already found how to check if the device is in potrait or landscape mode but i can't switch between the 2 XIBs... :(

Please help me! Thanks!

A: 

You should not use different XIBs for the same view. Instead, manipulate the view or set your autoresize masks correctly.

jrtc27
But, if i want use multiple XIB, is it possible? This because another person will create the landscape view... Thanks!
NotAGuRu
A: 

You can use one nib that has two views, a portraitView and a landscapeView. You would also need two of every IBOutlet you have (one for each orientation) and then set them up as usual. then when you need to rotate, replace self.view with the view you are rotating to, and set the outlets as necessary.

If the view is simple, however, using the autoresizing submasks effectively may be a better, simpler option.

Jesse Naugher