使用FGallery图像查看器

时间:2012-10-15 19:00:02

标签: objective-c ios ipad

我正在尝试实施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'

有人能帮助我吗?

由于

1 个答案:

答案 0 :(得分:0)

委托即自我。它将调用委托方法。 [[FGalleryViewController alloc] initWithPhotoSource:self];