こんにちは私はこのコードを持っています...
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
と
- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(UIInterfaceOrientationIsPortrait(interfaceOrientation)){
// WTF, this runs when I change to Landscape
} else {
// this runs when I change to Portrait??? shouldn't it be the contrary?
}
}
ご覧のとおり、コードは逆に実行されています。つまり、デバイスをポートレートに変更したときに実行する必要がある部分、コードのランドスケープ部分が実行され、その逆も同様です。
デバイスを回転させると、self.viewが回転します。
このUIInterfaceOrientationIsPortraitは、回転前のインターフェイスの状態をテストしていますか、それとも何かが足りませんか?
助けてくれてありがとう。