Je reçois tout à coup cet avertissement après la mise à niveauObj-C, décrément incorrect du nombre de références d'un objet qui n'appartient pas à ce point à l'appelant?
Incorrect decrement of the reference count of an object that is not owned at this point by the caller
Toutes les idées?
+ (void) drawGradientInRect:(CGRect)rect withColors:(NSArray*)colors{
NSMutableArray *ar = [NSMutableArray array];
for(UIColor *c in colors){
[ar addObject:(id)c.CGColor];
}
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
CGColorSpaceRef colorSpace = CGColorGetColorSpace([[colors lastObject] CGColor]);
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef)ar, NULL);
CGContextClipToRect(context, rect);
CGPoint start = CGPointMake(0.0, 0.0);
CGPoint end = CGPointMake(0.0, rect.size.height);
CGContextDrawLinearGradient(context, gradient, start, end, kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation);
CGColorSpaceRelease(colorSpace); //on this line
CGGradientRelease(gradient);
CGContextRestoreGState(context);
}