I have two UIColor instances and want to use them creating a gradient. The code works, but it gives me a warning when I call the arrayWithObject: constructor:
arrayWithObject:
Try this
UIColor *startColor, *endColor; // ... NSArray *colors = [NSArray arrayWithObjects: (id)startColor.CGColor, (id)endColor.CGColor, nil]; CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef) colors, NULL);