i got this message from the debugger:
Pixture(1257,0xa0610500) malloc: *** error for object 0x21a8000: pointer being freed was not allocated
*** set a breakpo
I had the same issue with the following code.
-(void)adjustImageToImageView:(UIImage*)img{
float numPixels = 100;
float radius = 5;
UIGraphicsBeginImageContext(CGSizeMake(numPixels, numPixels));
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextBeginPath(c);
CGContextMoveToPoint (c, numPixels, numPixels/2);
CGContextAddArcToPoint(c, numPixels, numPixels, numPixels/2, numPixels, radius);
CGContextAddArcToPoint(c, 0, numPixels, 0, numPixels/2, radius);
CGContextAddArcToPoint(c, 0, 0, numPixels/2, 0, radius);
CGContextAddArcToPoint(c, numPixels, 0, numPixels, numPixels/2, radius);
CGContextClosePath(c);
CGContextClip(c);
[img drawAtPoint:CGPointZero];
UIImage *converted = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.imageView.image = converted; }
I took the function from the open source Twitterfon app.
When I was trying to fix the issue, I tried changing the last line to
self.imageView.image = [converted retain]
And that stopped the error messages in the console. I'm going to check this in Leaks soon to see whats happening.