Note that there are some explanatory texts on larger screens.

plurals
  1. POBack button pressed, losing my custom UIToolBar when i pop the view controller off the stack
    primarykey
    data
    text
    <p>I hope everyone is having a great day so far. </p> <p>I'm running into a problem with my app that I need some help figuring out. I have a view controller (lets call "A") with a custom toolbar which works nicely.</p> <p>When I push a view controller (lets call it "locationsController") from view controller "A" ...</p> <pre><code>[self.navigationController pushViewController:self.locationsController animated:YES]; </code></pre> <p>...and I press the back button on the locationsController which closes like this...</p> <pre><code>[self.navigationController popViewControllerAnimated:YES]; </code></pre> <p>I lose my custom toolbar in view controller "A" when locationController is popped. How do I fix it so I can intercept and call my buildtoolbar method? </p> <p>Also, the locationsController can be pushed/popped from one other view controller so I'll need to determine which view controller is popping locationsController and either fire the buildtoolbar method or do nothing since the other view controller doesn't have a toolbar.</p> <p>view controller "A" is a XIB while locationsController is defined in the storyboard. the XIB does not Have a toolbar in the view/layout thingy.</p> <p>toolbar code called from viewDidLoad [self buildToolbar]...</p> <pre><code>-(void) buildToolbar{ blah blah blah self.navigationController.toolbarHidden = NO; UIBarButtonItem *flexableItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil]; UIBarButtonItem *refresh = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refresh:)]; UIBarButtonItem *comments = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Comments-selected.png"] style:UIBarButtonItemStyleDone target:self action:@selector(cameraButtonTapped:)]; UIBarButtonItem *pin = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Pin-straight_60wide.png"] style:UIBarButtonItemStyleDone target:self action:@selector(pinBarButtonItemPressed:)]; NSArray *items = [NSArray arrayWithObjects:customBarButtonItem_right, flexableItem, comments, flexableItem, pin, flexableItem, refresh, nil]; // [self.navigationController.toolbar setItems:items animated:YES]; self.toolbarItems = items; } </code></pre> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload