向きを変えて瞬時に画面の回転を取得したい。私のViewControllerにはUIImageとUILabelがあります。次のように私が行いますiPhone:画面が回転してからアプリケーションがクラッシュする
- (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];
を。
私が間違っていることを知っていますか?
ありがとうございます。
それは動作します。ありがとう! – TxabiGG