title: UIDeviceRGBColor getRed:green:blue:alpha - unrecognized selector, not due to memory management
body: <p>I solved my problem by using <code>CGColorGetComponents</code>, but I would like to understand exactly what was the reason.</p>
  
  <p>I was doing the following with an instance of <code>UIColor *firstColour</code> :</p>
  
  <pre><code>[firstColour getRed:&amp;r green:&amp;g blue:&amp;b alpha:nil];
  </code></pre>
  
  <p>This was working perfectly fine on simulator. Then I tested it on my device, and got this error :</p>
  
  <p><em>UIDeviceRGBColor getRed:green:blue:alpha unrecognized selector sent to instance</em></p>
  
  <p>After some research on the Internet I found that <code>UIColor</code> is actually replaced by subclasses, like <code>UIDeviceRGBColor</code>. Fine, but shouldn't subclasses work just like <code>UIColor</code> and accept (at least) the same methods ?</p>
  
  <p>I enabled Zombie but apparently this wasn't a memory management issue, like most people say on forums. And I can't find documentation for <code>UIDeviceRGBColor</code> so I don't know how it is supposed to behave. Does someone know why it happened, and above all, if this is likely to happen again with another method ?</p>
  
  <p>Thank you.</p>