title: Unrecognized selector UIDeviceRGBColor countByEnumeratingWithState:objects:count:
body: <p>I know this is kind of a dupe, but I don't have enough reputation yet to comment on the original post and, while I don't have an answer, I do have more useful information (a concrete example). Moderators, feel free to move this to the proper location.</p>
  
  <p>When compiling my code using the latest XCode 8 beta 6 (iOS 10 SDK), I get an exception "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDeviceRGBColor countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x600000071340'"</p>
  
  <p>This happens during the call:</p>
  
  <pre><code>    auto viewController = [[[UIViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
  </code></pre>
  
  <p>I have isolated the problem by whittling down my project to the bare minimum that will compile and still exhibit the problem. You can download it here:</p>
  
  <p><a href="https://www.dropbox.com/s/b7jggae97889xka/Bugtest.zip?dl=0" rel="noreferrer">Example project</a></p>
  
  <p>Note that I took out lots of code, nearly all classes are gone, which results in a lot of warnings (not errors) for nonexistent classes referenced from the xib. But that doesn't matter, the code still compiles and runs just fine with the iOS 9 SDK. After compiling with the iOS 10 sdk, however, it crashes both in the simulator and on devices running iOS 9.</p>
  
  <p>You can work around the problem by changing "#if 0" into "#if 1" in the file "HackForUnrecognizedSelectorInIOS10.m". This adds a category defining the missing selectors for UIColor. But obviously you can't add that to shipping code, it's just a temporary stopgap measure to continue developing.</p>
  
  <p>I filed a bug report (28153870). But if anyone has any more information on how to avoid this problem without ugly hacks, any information is welcome.</p>
  
  <p>Thanks</p>
  
  <p>Michel Colman</p>