title: xcode 5 CoreBluetooth not discovering services for peripheral
body: <p>I'm building several BLE apps, and have encountered this problem with my BLE protocols as well as external vendors. For the most part, BLE works as intended, but sometimes it will fail to discover services for a specific peripheral and will not work again until I restart or reset my phone.  </p>
  
  <p>Has anyone else experienced this problem?</p>
  
  <p>When I'm done with my peripheral, the manager will call the <code>closePeripheralConnection</code> method.  The relevant code:</p>
  
  <pre><code>// Disconnect from peripheral
  - (void)closePeripheralConnection
  {
      NSLog(@"== closePeripheralConnection ==");
      // If the peripheral is connected
      if (self.peripheral.state == CBPeripheralStateConnected &amp;&amp; self.peripheral != nil) {
          // Cancel connection
          [self.manager cancelPeripheralConnection:self.peripheral];
      } else {
          [self clearPeripheralSettings];
      }
  }
  
  // Clear peripheral settings
  - (void)clearPeripheralSettings
  {
      // Clear peripheral variables
      self.peripheral = 0;
      // Clear services
      self.service = 0;
      // Clear characteristic values
      self.data = 0;
      self.notifyCharacteristic = 0;
  }
  
  - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error
  {
      [self clearPeripheralSettings];
  }
  </code></pre>