title: +(void)load message not sent to framework class in device runtime
body: <p>I've trawled through questions here on SO looking for any hints to why I'm seeing this behaviour, and nothing yet.</p>
  
  <hr>
  
  <p>Consider a class (actually two classes exhibiting the same problem), built into a static library, wrapped in a framework bundle (<a href="http://simplyitinc.blogspot.com/2011/04/creating-static-framework-in-xcode-4.html" rel="nofollow">steps used</a>). They inherit from Foundation framework <a href="http://developer.apple.com/library/ios/documentation/General/Conceptual/DevPedia-CocoaCore/ClassCluster.html" rel="nofollow">class clusters</a> (<code>NSMutableDictionary</code> and <code>NSMutableArray</code>).</p>
  
  <p>The use of these classes relies on some static variables being initialised before a static function (<em>not class method!</em>) is used to allocate and initialise an instance (a kind of factory helper function I guess?).</p>
  
  <p>When an iOS app project links to that framework there is a difference the Objective-C runtime class loading behaviour between the Simulator and the Device.</p>
  
  <p>Specifically, on a device (iPhone 4, iOS 4.3.3) when the app is loaded these classes do not get a <code>+load</code> message, and the static vars do not initialize, therefore the static factory method fails. On the Simulator, the messages are sent, and all works as intended. Could it be a problem with the Device runtime having a </p>
  
  <p>My question is, can my framework be configured differently to ensure the <code>+load</code> messages are sent? Or have I run into a bug with static library/framework class loading in iOS?</p>
  
  <hr>
  
  <p>The classes are from the <a href="https://github.com/johnezang/JSONKit" rel="nofollow">JSONKit</a> library (<a href="https://github.com/johnezang/JSONKit/blob/master/JSONKit.m#L613" rel="nofollow"><code>JKArray</code></a>, <a href="https://github.com/johnezang/JSONKit/blob/master/JSONKit.m#L833" rel="nofollow"><code>JKDictionary</code></a>).</p>
  
  <p>An example project that illustrates this problem is here – <a href="https://github.com/ohhorob/JSONKit-in-framework-demo" rel="nofollow">https://github.com/ohhorob/JSONKit-in-framework-demo</a></p>
  
  <hr>
  
  <p>EDIT: As per @bbum's suggestion, I've verified that the <code>JKDictionary</code> and <code>JKArray</code> classes are in fact loaded and available while the application is running. The <code>DeviceBroken</code> branch on the GitHub project is updated with the verification used.</p>
  
  <p>I filed a bugreport (#9461567) with Apple.</p>