title: add navigation bar programmatically to a tableviewController (segue push or modal )
body: <p>I'm trying to programmatically add a navigationBar to a tableViewController :</p>
  
  <p><img src="https://i.stack.imgur.com/RS6uA.png" alt="Example screenshot:"></p>
  
  <p>When I come from a <em>PUSH</em> Segue the builder adds a navigation bar with navigation items, like I want.</p>
  
  <p>But the problem is that when i come form a <em>MODAL</em> Segue I try to add a bar with code like this:</p>
  
  <pre><code>UINavigationBar *naviBarObj = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, -260, 320, 44)];
  [self.view addSubview:naviBarObj];
  UIBarButtonItem *cancelItem = [[UIBarButtonItem alloc] initWithTitle:@"Cancel"         style:UIBarButtonItemStyleBordered target:self action:@selector(cancelButtonPressed)];
  UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:@selector(doneButtonPressed)];
  
  UINavigationItem *navigItem = [[UINavigationItem alloc] initWithTitle:@"Navigation Title"];
  navigItem.rightBarButtonItem = doneItem;
  navigItem.leftBarButtonItem = cancelItem;
  naviBarObj.items = [NSArray arrayWithObjects: navigItem,nil];
  
  ....
  
  - (void) cancelButtonPressed { }
  - (void) doneButtonPressed { }
  </code></pre>
  
  <p>But nothing appears... No top bar.</p>