Note that there are some explanatory texts on larger screens.

plurals
  1. POuse the same UINavigationBar object in all children views
    primarykey
    data
    text
    <p>hi im developing an ios aplication and the ui was desigbed using the storyboard (first time using it) so i have the folowing:</p> <ul> <li>entry point: navigation Controller</li> <li>rootView view controller (push to many other view some of one are UITableView)</li> <li>and then i programatically push (in some controllers) a view loaded from a nib (no problem on this)</li> </ul> <p>each controller has a defined title.</p> <p>what i want to do is put a rigth button on the nav bar of all view controller so i can push (programatically) to another controller (wish is in a nib, but i coul move it to the SB whit no problem)</p> <p>i have tried:</p> <ul> <li>using a custom class and an nib file but i get the same uncustumised nav bar</li> <li>overwriting initWithCoder so i can redirect it to de nib file but get an infinite loop (StakOverflow, yay!)</li> <li><p>using a second class to avoid the infinite loop but get an exception:</p> <blockquote> <p>Terminating app due to uncaught exception 'NSGenericException', reason: 'This coder requires that replaced objects be returned from initWithCoder:</p> </blockquote></li> <li><p>add the button manually in the init method of the navbar class, no efect</p></li> <li>replace the navigation bar in the navigation controller initWithCoder, no efect</li> <li>same but in the viewDidLoad method of the navigation controller, no efect</li> <li>same but in the rootView Controller, no efect</li> </ul> <p>the code i was using was this (and a few variations):</p> <pre><code>UIBarButtonItem *BTN = [[UIBarButtonItem alloc] initWithImage:[[UIImage alloc] initWithContentsOfFile:@"img.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(pushView)]; [[self navigationItem] setRightBarButtonItem:BTN]; </code></pre> <p>is ther any way that i can archive this, or should i do it manually view per view?</p> <p>--thanks</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.
 

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