iOS 6 l'orientation portrait ou paysage

J'ai une table avec une grande liste de choses qui vient à partir d'un fichier plist et en cliquant sur chacun d'entre eux vous emmène à un nouveau point de vue, un xib.

J'ai 2 points de vue à l'intérieur .xib, un portrait et un paysage

Dans mon h fichier j'ai ceci:

IBOutlet UIView *portraitView;  
IBOutlet UIView *landscapeView;

@property (nonatomic, retain) IBOutlet UIView *portraitView;  
@property (nonatomic, retain) IBOutlet UIView *landscapeView;

Dans ma m fichier présent:

[super viewDidLoad];  
    //Do any additional setup after loading the view from its nib.

    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:@"UIDeviceOrientationDidChangeNotification" object:nil];

}

- (void) orientationChanged:(id)object
{
    UIInterfaceOrientation interfaceOrientation = [[object object] orientation];

if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)  
    {  
        self.view = self.portraitView;  
    }  
    else
    {  
        self.view = self.landscapeView;  
    }  
}

- (void)viewDidUnload
{

    [super viewDidUnload];  
    //Release any retained subviews of the main view.  
    //e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation   
{  
    if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {  

       self.view = portraitView;
    } else if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {

       self.view = landscapeView;  
    }  
    return YES;

}

@end

Tout fonctionnait parfaitement sous iOS 5, montrant un paysage ou portrait en cas de besoin.

Maintenant avec la mise à jour iOS 6 tout est un gâchis.

Si je suis dans la table (portrait) et cliquez sur un élément, il montre correcte dans le portrait, si je tourne le paysage, la vue montre la vue correcte, MAIS le fait d'être dans le paysage, si je retourne à la table et de sélectionner un autre article, il montre le portrait au lieu de paysage.

Si je fais la même chose mais à partir du paysage, il montre le portrait.

Donc, maintenant, l'orientation n'est pas travailler pour rien.

La même chose arrive à mes autres points de vue à l'aide de storyboard. Ils sont le portrait et toujours montré comme ça, maintenant ils tournent, réduire le tout et laisser mon application que les ordures.

1 - Comment puis-je corriger l' .xib orientation chose ?
2 - Comment puis-je résoudre le storyboard de l'orientation ? (ils étaient statiques, maintenant tout tourne (pas de code))

Grâce.

OriginalL'auteur Peter | 2012-09-24