UIDeviceOrientationDidChangeNotification适用于iDevice 4及以下但不适用于iDevice 5

Fel*_*ipe 3 iphone ipod-touch uiinterfaceorientation ios6

花花公子!

需要一些紧急的见解.我的问题是,即使iPhone 4/4S和iPod 4上的测试正常旋转,此代码也是如此:

- (void)initNotifications
{
    [[NSNotificationCenter defaultCenter] postNotificationName:@"setFreeOrientation" object:nil];

    [[UIDevice currentDevice]beginGeneratingDeviceOrientationNotifications];
    [[NSNotificationCenter defaultCenter]addObserver:self
                                            selector:@selector(didRotate:)
                                                name:UIDeviceOrientationDidChangeNotification
                                              object:Nil];
}

-(void)didRotate:(NSNotification*)notification
{
    [super rotateTopBars];
    [super rotateOptionsBar];
    [self rotateControlBar];
    [self rotatePlayer];
    [super rotateShareLayer];
}
Run Code Online (Sandbox Code Playgroud)

但我正在测试iPod 5并且它不起作用.尝试了一些东西但直到现在都没有运气.

干杯.

Ste*_*arp 6

我有一个类似的问题UIDeviceOrientationDidChangeNotification,它在一台设备上运行良好,但不是另一台设备.经过一些调试后,我意识到我的设备上已经锁定了纵向方向,这导致UIDeviceOrientationDidChangeNotification根本没有发射.不确定这是否是你的问题,但这是容易被忽视和值得检查的东西.

纵向方向已锁定