UIGraphicsGetImageFromCurrentImageContext , alloc version?
UIGr开发者_如何学运维aphicsGetImageFromCurrentImageContext returns autoreleased UIImage.
Wonder if there is a way to get "alloc"-ed image from context?
I want something equivalent to following code, maybe the code is best I can do?
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
UIImage* image = get image by UIGraphicsGetImageFromCurrentImageContenxt
[image retain];
[pool release];
Just call -retain
on the result.
UIImage *image = [UIGraphicsGetImageFromCurrentImageContext() retain];
精彩评论