iOS 8 Xcode 6.1 crash sending color - solved


#1

I was getting an error, crashing actually sending the color to the BNRColorViewController.
The warnings were "Incompatible pointer types sending ‘float *’ to parameter of type ‘CGFloat *’ (aka ‘double *’)"
Running the app with the code as is causes EXEC_BAD_ACCESS

Changing from “float” to “CGFloat” fixed the crash.

// Get the RGB values out of the UIColor object
CGFloat red, green, blue;
[color getRed:&red
green:&green
blue:&blue
alpha:nil];