与MWPhotoBrowser崩溃

时间:2013-10-21 15:13:31

标签: ios objective-c xcode

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

[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方法 有人有这个问题吗?

1 个答案:

答案 0 :(得分:0)

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

相关问题