『iPhoneアプリ開発塾』chapter6-3
画面を回転させるUIInterfaceOrientationを学習しました。
今日からiOS7、Xcode5.0にアップデートされている関係なのか、本書のサンプルコード通りではエラーになってしまうという現象がありました。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)InterfaceOrientation
これの最後"InterfaceOrientation"Xcodeでは"toInterfaceOrientation"でした。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
それに伴って、以下のコードも変わります。
return (toInterfaceOrientation == UIInterfaceOrientationPortrait
|| nterfaceOrientation == UIInterfaceOrientationLandscapeLeft
|| InterfaceOrientation == UIInterfaceOrientationLandscapeRight
|| InterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown
);
これはこうなります。
return (toInterfaceOrientation == UIInterfaceOrientationPortrait
|| toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft
|| toInterfaceOrientation == UIInterfaceOrientationLandscapeRight
|| toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown
);
また、以下のコードを入れたままにすると逆にエラーになりました。
UIInterfaceOrientation toInterfaceOrientation = self.interfaceOrientaiton;
削除すると、ビルド成功しました。
これは、iOS、Xcodeのアップデートによるものなのか、どうなのか。不明です。