title: Automatically connecting to a previous Bluetooth device through Objective C
body: <p>My program allows users to connect to a bluetooth device and it'll save the UUID. The next time the application launches, it automatically connects to a previously connected device.</p>
  
  <p>I'm saving the UUIDs in<code>[NSUserDefaults standardUserDefaults]</code> in an NSArray.</p>
  
  <p>I'm able to retrieve the first device and connect to it, by using the <code>retrievePeripherals</code> method for <code>CBCentralManager</code>, and passing in an array of UUIDs that I stored.</p>
  
  <p>My problem is, I don't know how to handle for errors. I want the program to know if it failed to connect to the first UUID and go onto the next one. The delegate method <code>didRetrievePeripherals</code> seems to retrieve the device with the specific UUID, even though I turned the device OFF. </p>
  
  <p>Did anyone else have the same problem?</p>