I solved my problem by using CGColorGetComponents
, but I would like to understand exactly what was the reason.
I was doing the following with an instance of UIColor *firstColour
:
[firstColour getRed:&r green:&g blue:&b alpha:nil];
This was working perfectly fine on simulator. Then I tested it on my device, and got this error :
UIDeviceRGBColor getRed:green:blue:alpha unrecognized selector sent to instance
After some research on the Internet I found that UIColor
is actually replaced by subclasses, like UIDeviceRGBColor
. Fine, but shouldn't subclasses work just like UIColor
and accept (at least) the same methods ?
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 UIDeviceRGBColor
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 ?
Thank you.