NIToolBarPhotoViewController to display images from a selected image

394 Views Asked by At

I am using Nimbus to display photos. I have a tableviewcontroller displaying list of filenames. When the user select particular file (if an image) , it displays all the image files in viewcontroller extended from NIToolBarPhotoViewController starting fromt the first element of my photo source array i.e. photoFiles which is the first element in list.

I am returning the total count for scrollview pages like this:

- (NSInteger)numberOfPagesInPagingScrollView:(NIPhotoAlbumScrollView *)photoScrollView {
    return self.photoFiles.count;
}

However, I am unable to launch the photoview from a particular index as the method:

  - (UIImage *)photoAlbumScrollView: (NIPhotoAlbumScrollView *)photoAlbumScrollView
                     photoAtIndex: (NSInteger)photoIndex
                        photoSize: (NIPhotoScrollViewPhotoSize *)photoSize
                        isLoading: (BOOL *)isLoading
          originalPhotoDimensions: (CGSize *)originalPhotoDimensions

gets called directly as per the example NetworkPhotoAlbumViewController. How can I get it to take the particular index before launch the photoview?

1

There are 1 best solutions below

0
On

in viewDidLoad add this line

[self.photoAlbumView setCenterPageIndex:photoIndex];    

to set index of displayed photo