title: Understanding crash in Cocos2d iOS game
body: <p>I'm trying to understand a crash reported by my crash reporting service. The report is:</p>
  
  <pre><code>Exception Type: EXC_BAD_ACCESS    Code: KERN_INVALID_ADDRESS at 0x12341234
  
  0   libobjc.A.dylib    _cache_getImp + 3
  2   libobjc.A.dylib    class_respondsToSelector + 30
  3   CoreFoundation     objectIsKindOfClass + 36
  4   CoreFoundation     __handleUncaughtException + 68
  5   libobjc.A.dylib    _objc_terminate() + 128
  6   libc++abi.dylib    safe_handler_caller(void (*)()) + 78
  7   libc++abi.dylib    std::terminate() + 19
  8   libc++abi.dylib    __cxa_rethrow + 94
  9   libobjc.A.dylib    objc_exception_rethrow + 12
  10  CoreFoundation     CFRunLoopRunSpecific + 456
  11  CoreFoundation     CFRunLoopRunInMode + 104
  12  GraphicsServices   GSEventRunModal + 74
  13  UIKit              UIApplicationMain + 1120
  14  MyCocos2diOSGame    
  main.m line 6
  main 
  </code></pre>
  
  <p>The crash reporting service emphasises the following line:</p>
  
  <pre><code>3   CoreFoundation     objectIsKindOfClass + 36
  </code></pre>
  
  <p><strong>What is happening in this crash?</strong></p>
  
  <p>I'm familiar with the usual crashes like "index out of bounds", "class doesn't respond to selector" etc. However this particular crash baffles me. Line two mentions <code>class_respondsToSelector</code> so maybe the code is trying to call a non-existant selector on a class? If that's the case then why isn't the selector mentioned by name?</p>
  
  <p>Any insight is very helpful! Thanks in advance.</p>