画面の向きを変えるときに、画面を瞬時に回転させたいのですが。私のViewControllerには、1つのUIImageと1つのUILabelがあります。私は次のようにします:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
[self willRotateToInterfaceOrientation:[self interfaceOrientation] duration:0];
}
ラインアプリがなくてもクラッシュしません:
[self willRotateToInterfaceOrientation:[self interfaceOrientation] duration:0];
期間をゼロに設定しようとするコード行では、ローテーションが終了した直後にアプリがクラッシュします。
私が間違っていることについて何か考えはありますか?
ありがとうございました。