gdavis / FGallery-iPhone

Objective-C based gallery for iPhones
583 stars 144 forks source link

Arc problem with UINavigationController #27

Open saturngod opened 12 years ago

saturngod commented 12 years ago

Following code is working but there is no NavigationBar

promoGallery* gallery = [[promoGallery alloc] init];
gallery.imageArray = self.fullImageArray;

FGalleryViewController* pVC = [[FGalleryViewController alloc] initWithPhotoSource:gallery];
pVC.currentIndex = btn.tag;

[self presentModalViewController:pVC animated:YES];

So, I put navigation controller like below and it crash

promoGallery* gallery = [[promoGallery alloc] init];
gallery.imageArray = self.fullImageArray;

FGalleryViewController* pVC = [[FGalleryViewController alloc] initWithPhotoSource:gallery];
pVC.currentIndex = btn.tag;

UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:pVC];

[self presentModalViewController:navController animated:YES];

I check the code and it's problem in

- (void)updateScrollSize
{
float contentWidth = _scroller.frame.size.width * [_photoSource numberOfPhotosForPhotoGallery:self];
[_scroller setContentSize:CGSizeMake(contentWidth, _scroller.frame.size.height)];
}

there is no _photoSource after init with UINavigationBar

Erzekiel commented 10 years ago

Thanks for this post, you saved my day...