我正在尝试实现 FGallery imageviewer。我有一个方法,它为我提供了我想要显示的所有照片 URL 的数组。接下来我实现了以下 FGallery 方法。
- (int)numberOfPhotosForPhotoGallery:(FGalleryViewController *)gallery
{
return [_picturesForAlbum count];
}
- (FGalleryPhotoSourceType)photoGallery:(FGalleryViewController *)gallery sourceTypeForPhotoAtIndex:(NSUInteger)index
{
return FGalleryPhotoSourceTypeNetwork;
}
- (NSString*)photoGallery:(FGalleryViewController *)gallery urlForPhotoSize:(FGalleryPhotoSize)size atIndex:(NSUInteger)index {
return [_picturesForAlbum objectAtIndex:index];
}
在我的 didSelectRowForIndexPath 中我做了这个。
networkGallery = [[FGalleryViewController alloc] initWithPhotoSource:self.picturesForAlbum];
[self.navigationController pushViewController:networkGallery animated:YES];
但我不知道应该在 initWithPhotoSource 中放什么。当我拥有它时。我不断收到以下错误。
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM numberOfPhotosForPhotoGallery:]: unrecognized selector sent to instance 0xc95bb60'
有谁能够帮我?
谢谢