日々精進

新しく学んだことを書き留めていきます

iPhone画面回転系イベントが呼ばれない

willRotateToInterfaceOrientationとかがなぜか呼ばれないと思っていたら下記サイトによるとrootViewControllerのwillRotateToInterfaceOrientationしか呼ばれないらしい!なんでだよ・・・
http://www.iphonedevsdk.com/forum/iphone-sdk-development/3098-willrotatetointerfaceorientation-doesnt-get-called.html


解決策はUIDeviceOrientationDidChangeNotificationを受け取って処理すること。
下記サイトにやり方が書いてある。
http://d.hatena.ne.jp/KishikawaKatsumi/20090510/1241968017