0

我已经在我的项目中导入了最新版本的 MWPhotoBrowser 类,但是当浏览器从网络加载图像时,应用程序崩溃了。在实现中,我使用在演示项目中创建的相同代码,如果我显示本地图像就可以了。这是我的实现:

[galleryPhotosArray addObject:[MWPhoto photoWithImage:[UIImage imageNamed:@"Blue_Screen_iPhone.png"]]];
[galleryPhotosArray addObject:[MWPhoto photoWithImage:[UIImage imageNamed:@"Logo_iPhone.png"]]];
[galleryPhotosArray addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://www.cellulare.it/wp-content/uploads/2013/09/apple1.png"]]];

MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
browser.displayActionButton = YES;
browser.displayNavArrows = NO;
browser.wantsFullScreenLayout = YES;
browser.zoomPhotosToFill = YES;
[browser setCurrentPhotoIndex:0];

[self.navigationController pushViewController:browser animated:YES];

[browser release];

所以我添加了两个本地图像和一个来自谷歌图像的随机图像。应用程序在两点崩溃,有时在 SDWebImageDownloaderOperation.m 的这一行中:

self.connection = [NSURLConnection.alloc initWithRequest:self.request delegate:self startImmediately:NO];

第二点在 SDImageCache.m 文件中,在 - (NSString *)cachePathForKey:(NSString *)key inPath:(NSString *)path 方法有人有这个问题吗?

4

1 回答 1

0

我的错误,我只向 SDWebImage 文件添加了 ARC 支持。

于 2013-10-22T20:47:40.613 回答