title: iOS - how to create a navigation bar item in view controller?
body: <p>I have been trying to create a navigation bar back button. </p>
  
  <p>Here is my code :-</p>
  
  <pre><code>UIBarButtonItem *barButton = [[[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:nil]autorelease];
  self.navigationItem.rightBarButtonItem = barButton;
  </code></pre>
  
  <p>But it isn't displaying anything on navigation bar.</p>
  
  <p>I am using UIViewController, not an UINavigationController.</p>
  
  <p>Is UINavigationController is the only way to achieve this?</p>
  
  <p>Any help would be really appreciated.</p>
  
  <p>Any link to a good tutorial will be great.</p>
  
  <p>Thanks.</p>