title: Sphero AR Example Crashes Randomly
body: <p>I'm testing the Sphero-AR-SDK found on GitHub (<a href="https://github.com/orbotix/Sphero-AR-SDK" rel="nofollow">https://github.com/orbotix/Sphero-AR-SDK</a>)</p>
  
  <p>When testing, I seem to have random crashes on connect.</p>
  
  <p>The issue I'm trying to debug is an index out of range error.</p>
  
  <pre><code>*"*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
  *** First throw call stack:
  (0x325102a3 0x3a22d97f 0x3245bb75 0x8cb42b 0x32e270f5 0x324e5683 0x324e4ee9 0x324e3cb7 0x32456ebd 0x32456d49 0x3602d2eb 0x3436c301 0x7f10 0x3188)
  libc++abi.dylib: terminate called throwing an exception"*
  </code></pre>
  
  <p>This happens a fair amount when booting the application but not all the time (sometimes it will get through and play the game).</p>
  
  <p>I was wondering if anyone else was having issues with these random crashes or have I not set it up correctly?
  I've had a look at the "Other Linker Flags" in XCode too and it has <code>-all_load</code>.</p>
  
  <p>Also, I've safely checked the only place where I could find an array object access in the .mm files (RKUNBridge.mm) has this line:</p>
  
  <pre><code>[RKDeviceSensorsData *data = [sensors_data.dataFrames objectAtIndex:0];
  </code></pre>
  
  <p>And I safely checked this array exists and is greater than one to double check it's not this line.</p>
  
  <p>Any ideas or suggestions would be much appreciated.</p>
  
  <p>Thanks for reading.</p>