[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(deviceOrientationDidChange:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
-(void)deviceOrientationDidChange:(NSObject*)sender{
UIDevice* device = [sender valueForKey:@"object"];
NSLog(@"%d",device.orientation);
}

5707

被折叠的 条评论
为什么被折叠?



