我正在开发一个iPhone应用程序,使用coverFlow视图,当应用程序构建卡片时,它使用UIView添加标签和其他内容。然后,我使用以下代码将UIView转换为UIImage:
UIGraphicsBeginImageContext(imageView.bounds.size);
[imageView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// returning the UIImage
return viewImage;
每次我重新绘制Coverflow时,内存都会大量增加,即使我dealloc CoverFlow视图也无法减少内存。我认为内存泄漏是在我添加的代码中,你认为呢?