Skip to content

Commit

Permalink
Adds code to release toolbar buttons when the view has unloaded. Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavis committed Feb 19, 2012
1 parent 98772c0 commit 9cfd340
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions FGallery/Classes/FGalleryViewController.m
Expand Up @@ -196,6 +196,7 @@ - (void)loadView
[_captionContainer addSubview:_caption];

// create buttons for toolbar
NSLog(@"_nextButton: %@", _nextButton);
UIImage *leftIcon = [UIImage imageNamed:@"photo-gallery-left.png"];
UIImage *rightIcon = [UIImage imageNamed:@"photo-gallery-right.png"];
_nextButton = [[UIBarButtonItem alloc] initWithImage:rightIcon style:UIBarButtonItemStylePlain target:self action:@selector(next)];
Expand All @@ -219,6 +220,9 @@ - (void)viewDidUnload {

[self destroyViews];

[_barItems release], _barItems = nil;
[_nextButton release], _nextButton = nil;
[_prevButton release], _prevButton = nil;
[_container release], _container = nil;
[_innerContainer release], _innerContainer = nil;
[_scroller release], _scroller = nil;
Expand Down

0 comments on commit 9cfd340

Please sign in to comment.