なんかxcodeのバージョンを上げたら,画面の回転をしない設定をしていたのに何度やっても回転するようになってしまいました.実行を追ってみると,いつまでたってもshouldAutorotateToInterfaceOrientationが呼ばれません.
そこで調べたら,iOS6はshoudAutorotateToInterfaceOriantationがdeprecatedで動かんよって言ってる.
その代わりsupportedInterfaceOrientationsとshouldAutorotateを使えと
今まで
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return interfaceOrientation == UIInterfaceOrientationPortrait;
}
みたいにやっていたのを,
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
てな感じでやればOKということで.
なるほどなるほど.