Не возвращается значение мусора.
Сравните значение со следующими константами:
UIInterfaceOrientationLandscapeLeft;
UIInterfaceOrientationLandscapeRight;
UIInterfaceOrientationPortrait;
UIInterfaceOrientationPortraitUpsideDown;
т.
if (fromInterfaceOrientation == UIInterfaceOrientationPortrait) {
NSLog(@"PORTRAIT");
}
Или используйте следующие макросы BOOL:
UIInterfaceOrientationIsLandscape(fromInterfaceOrientation);
UIInterfaceOrientationIsPortrait(fromInterfaceOrientation);
т.
if (UIInterfaceOrientationIsPortrait(fromInterfaceOrientation)) {
NSLog(@"PORTRAIT");
}