0

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

有谁能够帮我?

谢谢

4

1 回答 1

0

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

于 2012-12-11T11:56:35.247 回答