仪器中的UIImage泄漏

时间:2012-11-19 19:39:52

标签: iphone ios6 instruments

当按下UIButton从文件加载图像以进行scrollview时,它会泄漏到乐器中

泄漏对象是UIImage

尺寸是48字节

负责图书馆是基础

负责任框架是_NSThread_main _

当我点击地址箭头获取历史记录

类别事件类型RefCt大小负责图书馆负责人来电

Malloc 32 Bytes Malloc 1 32 libsystem_c.dylib strdup Malloc 32 Bytes Free 0 -32 libsystem_c.dylib asl_client_release UIImage Malloc 1 48基础 NSThread_ 主要 UIImage保留2 0基础 NSThread _main UIImage保留3 0基础__NSThreadPerformPerform UIImage保留4 0基础__NSThreadPerformPerform UIImage Release 3 0 Foundation __NSThreadPerformPerform UIImage保留4 0基础 - [NSInvocationOperation main] UIImage保留5 0基础 - [NSInvocationOperation main] UIImage Release 4 0基金会 - [NSInvocationOperation main] UIImage Release 3 0基金会 - [NSInvocationOperation main] UIImage Release 2 0 Foundation __NSThreadPerformPerform UIImage Release 1 0 Foundation - [NSInvocationOperation dealloc]

-(void)ScrollView:(id)sender
{
NSMutableArray *photos = [[[NSMutableArray alloc] init]autorelease];

Photo *photo;

photo = [Photo photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"image0" ofType:@"png"]];
[photos addObject:photo];

photo = [Photo photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"image1" ofType:@"png"]];
[photos addObject:photo];

photo = [Photo photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"image2" ofType:@"png"]];
[photos addObject:photo];

photo = [Photo photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"image3" ofType:@"png"]];
[photos addObject:photo];

photo = [Photo photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"image4" ofType:@"png"]];
[photos addObject:photo];

photo = [Photo photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"image5" ofType:@"png"]];
[photos addObject:photo];

 ImageViewController *imageviewcontroller = [[[ImageViewController alloc] initWithPhotos:photos]autorelease];

imageviewcontroller.displayActionButton = YES;

UINavigationController *navigationController = [[[UINavigationController alloc]
                                                initWithRootViewController:imageviewcontroller]autorelease];

navigationController.navigationBar.tintColor = [UIColor clearColor];

[self presentViewController:navigationController animated:YES completion:NULL];
}

 + (Photo *)photoWithFilePath:(NSString *)path {
return [[[Photo alloc] initWithFilePath:path]autorelease];

如果有人可以就问题可能提出一些想法,那么我将非常感激。

提前致谢。

0 个答案:

没有答案