title: beginGeneratingDeviceOrientationNotifications How to work
body: <pre><code>    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
      [notificationCenter addObserver:self selector:@selector(deviceOrientationDidChange) name:UIDeviceOrientationDidChangeNotification object:nil];
      orientation = AVCaptureVideoOrientationPortrait;
  </code></pre>
  
  <p>I want to know beginGeneratingDeviceOrientationNotifications means what and how to work?</p>