I’ve started using the CAGradientLayer but my app crashes
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.frame = headerView.bounds;
gradient.colors = [NSArray arrayWithObjects:(id)[UIColor redColor],(id)[UIColor greenColor], nil];
[headerView.layer addSublayer:gradient];
EXEC_BAD_ACESS
Is there an error in my implementation?
It’s a small bug – you need to use and array of
CGColorRefpointers: