Using this code causes a Bus Error. Can someone point out what is wrong with it? I'm overriding a method from CALayer.
- (void) setBackgroundColor:(CGColorRef)c
{
float *components = (float *)CGColorGetComponents(c);
[super setBackgroundColor:[LOLColors colorWithRed:components[0] green:components[1] blue:components[2] alpha:transparencyLevel]];
}
P.S. colorWithRed:green:blue:alpha is a class method which works perfectly fine.
That's the prototype:
+ (CGColorRef) colorWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha