title: iPhone proximity monitoring
body: <p>I have this app that monitors you through out the day. When you place your device in your pocket, the screen will turn off using the proximity sensor to conserve battery. My problem is it still is not conserving enough battery so I am trying to detect when the proximity state changes the proximity monitoring will disable. This brings me more problems because the proximity monitoring will stop but not until you uncover the sensor.
  Here is my Code.<br/></p>
  
  <pre><code>- (void)viewDidLoad{
  [super viewDidLoad];
  [[UIDevice currentDevice] setProximityMonitoringEnabled:YES];
  [[UIDevice currentDevice] proximityState];
  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(proximityStateDidChange) name:UIDeviceProximityStateDidChangeNotification object:nil];
  [self curTime];
  }
  -(void)proximityStateDidChange{
  [[UIDevice currentDevice] setProximityMonitoringEnabled:NO];
  NSLog(@"Disabled");
  }
  </code></pre>