Working around the UUID problem in iOS 6.0

Hi !

So when I updated my devices to iOS 6.0 I started seeing random crashes on my apps.

The app would just crash without any warning, so I ran them in the xCode and found out that it crashed in the CFUUIDCreateString routing and that the UUID property of the peripheral was NULL.

What I found out after some research was that there was only some peripherals that crashed the app and also that the same peripherals that crashed the app on one iOS device, did not crash it on other devices.

I also saw that the application I was writing that connects to the device without showing the UUID would not crash, and that the device then could afterwards be used time and time again with the crashing apps !

My conclusion is that there is a problem with the UUID generation routine and that if one connects to the device, and then disconnects again, the device will never crash the app again.

So the workaround was simple :

When discovering devices :

In didDiscoverPeripheral run connectPeripheral.

Then when didConnectPeripheral callback is called, the UUID property is correct, and from there this device will always function on this iOS device.

I have entered this in a bug report to Apple, so we’ll se if they will fix it in their next maintenance release.

 

Ole

This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Working around the UUID problem in iOS 6.0

  1. David says:

    what’s the link to the bug report? thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">