NIToolbarPhotoViewController with photos in app bundle

176 views
Skip to first unread message

Jon

unread,
Nov 15, 2011, 4:29:07 PM11/15/11
to Nimbus iOS Framework
Are there any examples available using NIToolbarPhotoViewController
with non-network images? I have the images in my application bundle
that I would like to present through this class. I have tried a few
tweaks of the NetworkPhotoAlbum example with my own subclass
(subclassing NIToolbarPhotoViewControlle directly, not
NetworkPhotoAlbumViewController). However, even when I hardcode the
following two methods in my subclass to return an image using +
imageNamed, I get blank screen.

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

- (UIImage *)photoScrubberView: (NIPhotoScrubberView
*)photoScrubberView
thumbnailAtIndex: (NSInteger)thumbnailIndex

Based on my current understanding, it seems that any class should be
able to subclass NIToolbarPhotoViewController and implement these two
methods below as a very basic start. However, even with these two
datasource methods implemented as shown, I receive a blank screen.
Though, I still get the view showing the correct photo count (4 of 10,
for example) and can click through using the forward/back arrows, I
end up with no actuall images displaying. I was expecting the
default.png to show up 10 times.

- (NSInteger)numberOfPhotosInPhotoScrollView:(NIPhotoAlbumScrollView
*)photoScrollView {

return 10;
}

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

return [UIImage imageWithContentsOfFile:
NIPathForBundleResource(nil, @"NimbusPhotos.bundle/gfx/
default.png")];

}

dmitri...@gmail.com

unread,
Feb 23, 2012, 12:05:07 PM2/23/12
to nimb...@googlegroups.com
I have the same problem. There is a solution?

asadkh...@gmail.com

unread,
Dec 20, 2012, 12:25:22 PM12/20/12
to nimb...@googlegroups.com
I am having the very same problem, I thought I was the only one.
Reply all
Reply to author
Forward
0 new messages