[iPhone] deviceOrientationChanged
- (void)deviceOrientationChanged:(GSEvent *)event;
このイベントは,SpringBoard経由でアプリケーションを実行しないとコールされない.
ssh経由でプログラムを実行すると呼ばれないわけだ.
int screenOrientation = [UIHardware deviceOrientation:YES];
上記のメソッドで,傾きを読んだときの値は,
・0 - Phone is flat (on a table?) with screen upwards
・1 - Phone is in normal position
・2 - Phone is rotated upside-down
・3 - Phone is rotated to the left
・4 - Phone is rotated to the right
・5 - Phone is changing orientation ?
・6 - Phone is flat, with screen downwards - very useful!
だそうです(CocoaDevより抜粋).