Маловероятно, что проблема исходит из (1);Вероятно, ошибка связана с тем, что вы читаете элемент statusBarOrientation
из потока, отличного от основного.
Вот как вы можете прочитать statusBarOrientation
из основного потока:
dispatch_async(dispatch_get_main_queue(), ^(void){
// Now, we are in the context of the main (GUI) thread. You can perform any GUI updates here.
self.frame = [[[UIApplication sharedApplication] delegate] window].bounds;
UIInterfaceOrientation orientation = UIApplication.sharedApplication.statusBarOrientation;
// Put any other code that makes use of the "orientation" variable inside here
});
С этого момента все зависит от того, что вы хотите сделать с переменной orientation
.