【发布时间】:2010-09-22 11:24:36
【问题描述】:
我想学习分配 uiimage 并释放它以进行内存管理的正确方法。
当我使用以下代码时,它会在解除分配时崩溃,
如果我不使用 [成像器版本];
程序没有崩溃,但它显示成像仪泄漏。有什么解决办法吗?
UIImage *imager = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:s@"nameofimage" ofType:@"jpg"]];
UIImageView *imageView = [[UIImageView alloc] initWithImage:imager];
[imageView release];
[imager release];
【问题讨论】:
标签: uiimageview uiimage release memory-leaks