I have this an array called self.gradientArray of colors. When I print it out it looks like this:
gradientsArray: (
"UIDeviceRGBColorSpace 0.333333 0.811765 0.768627 1",
"UIDeviceRGBColorSpace 0.333333 0.811765 0.768627 1" )
I want to convert this array into a CGFloat array. An example is like this:
CGFloat colors [] = {
1.0, 1.0, 1.0, 1.0,
1.0, 0.0, 0.0, 1.0
};
I tried this and it didn't work. I'm new to Objective-C and the syntax so please help me.
CGFloat colors [] = self.gradientArray;
I want to use the CGFloat array in making gradients like this:
CGGradientRef gradient = CGGradientCreateWithColorComponents(baseSpace, colors, NULL, 2);
NSArrayofUIColorobjects, which, when youNSLogit, generates output much like he shared in his question.