0

I am using mmdrawercontroller in my app...when i select a tableviewcell from drawer, i push tableview A on my navigational controller and then on selection of tableviewcell from tableview A, i push tableview B on my navigational controller...tableview B appears and then immediately pops back to tableview A.

I debugged on viewdidload method of tableview B, navigational controller has tableviewB pushed over it along with tableview A and home view...all tableview methods of tableview B get fired too..but afterwards somehow tableviewB pops up and am back on tableview A... any reasons for this weird behaviour ..?

NOTE

however, when i present modally over a custom created uinavigational controller (through following code snippet), it behaves normally..and doesn't gets popped off....

 UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:tableviewB];

[self presentViewController:navigationController
                   animated:YES
                 completion:^{
                    NSLog(@"presenting modally rather pushing"); 
                 }];

so definitely somethings going wrong with navigational controller..

Waseem Lateef
  • 151
  • 1
  • 6

1 Answers1

0

Share my thoughts written in swift, If you want to push tableViewB from tableViewA, In your AppDelegate:

self.window = UIWindow()    
let tvc = TableViewAController()
let nvc = UINavigationController(rootViewController: tvc)    
window.rootViewController = nvc
window.makeKeyAndVisible()

and when you want to push tableViewB in tableViewA:

let nextVC = TableViewBController()
nvc.pushViewController(nextVC)