Bajrang Sinha
Bajrang Sinha

Reputation: 28

How to POP to view Controller by programatically created Navigation Controller

I currently use the following code to show my View Controller

 FilterIncident *filterIncident_VC=[[FilterIncident alloc]init];
filterIncident_VC.title=@"Filter Incident";
WGNMenuNavigationController *navigationController = [[WGNMenuNavigationController alloc] initWithRootViewController:filterIncident_VC];
navigationController.navigationBar.barTintColor = [UIColor colorWithRed:229/255.0f green:41/255.0f blue:51/255.0f alpha:1.0f];
navigationController.navigationBar.tintColor = [UIColor whiteColor];
[navigationController.navigationBar
 setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
navigationController.navigationBarHidden = true;
self.frostedViewController.contentViewController = navigationController;
[self.frostedViewController hideMenuViewController];

and for POPing i use the following code

    WGNMenuNavigationController *navigationController = [[WGNMenuNavigationController alloc] initWithRootViewController:self.containerViewController];
[navigationController popViewControllerAnimated:YES];

I Unable to pop my view Controller. Any Help. Thanx in advance.

Upvotes: 0

Views: 49

Answers (1)

Vishal Sonawane
Vishal Sonawane

Reputation: 2693

You can't pop a ViewController unless and until you push it. From your code it seems you are not pushing it from anywhere.

Upvotes: 1

Related Questions