Questions tagged [poptoviewcontroller]

popToViewController is method in UINavigationController class that is part of iOS SDK. By calling this method you pop view controllers until the specified view controller is at the top of the navigation stack.

The definition of method is next:

- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;

Parameters

  1. viewController: The view controller that you want to be at the top of the stack.

  2. animated: Set this value to YES to animate the transition. Pass NO if you are setting up a navigation controller before its view is displayed.

Return Value

An array containing the view controllers that were popped from the stack.

82 questions
2
votes
1 answer

popToRootViewControllerAnimated causing a crash when ARC enabled

I have a non-arc project. Within my project, I have enabled arc in a few ViewControllers using -fobjc-arc. If I call popToRootViewControllerAnimated from an arc enabled VC, I get a crash.. If I remove arc from that VC, then…
2
votes
0 answers

iOS7 black bar appears when navigation pops to last view

only happens in iOS7. when i click back item, there's always a black bar between navigationBar and controller view, and the view moves to top.
Aldrin
  • 21
  • 1
2
votes
4 answers

popToViewController is not working "Tried to pop to a view controller that doesn't exist"

I am trying to use popToViewController and it I keep getting the error "Tried to pop to a view controller that doesn't exist"? I am in a Settings view and when the user clicks "Sign Out" I dismiss the Settings VC and segue back to the mainView…
jdog
  • 10,351
  • 29
  • 90
  • 165
2
votes
2 answers

Pop to rootviewcontroller when tabbarcontroller is dismissed?

I have login screen (viewcontroller) and then another signature screen (viewcontroller). Then tabbar controller is presented above signature screen. when the user tap logout button in tabbar controller stack the app should navigate to login screen.…
2
votes
2 answers

popToViewController not animating

Man I must say if it wasn't for this site, I would have no hair and I would've probably jumped off of a bridge right now. OK! My problem: I'm using storyboard with xcode 4.4. I have a 3 view controllers (well 5 really but the others i THINK are…
1
vote
2 answers

pushViewController and popToRootViewController

My application is using pushViewController to show the navigation controller modally [navigationController pushViewController:_viewController animated:YES]; Navigation Controller has done button UIButton* backButton = [UIButton…
1
vote
1 answer

Navigation in iOs 5 using coding

guys I am creating application in iOs 5 using storyBoard. StoryBoard is grete thing for easy navigation.But I am facing some problem in coding with iOs 5. this is the problem.. First i create a new project in iOs 5 using wit storyboard and i create…
Chirag Patel
  • 11,416
  • 3
  • 26
  • 38
1
vote
2 answers

popToRootViewController forward animation

In my library I have a loading view which pops to a input view. When the user is done with the input view it should go back to the loading view to do some magic again and when done it should show up a third view. Now, from a usability view I don't…
Paul Peelen
  • 10,073
  • 15
  • 85
  • 168
1
vote
4 answers

Swift 3 : Back to last ViewController with sending data

I'm trying to go back to my las viewController with sending data, but it doesn't work. When I just use popViewController, I can go back to the page, but I can't move my datas from B to A. Here is my code : func goToLastViewController() { let vc…
jorjj
  • 1,479
  • 4
  • 20
  • 36
1
vote
2 answers

IOS navigationController?.popToRootViewController has wrong

@IBAction func addInformation(_ sender: UIBarButtonItem) { // check rateHourly has value if let editedRateHourly = rateHourly.text { print("editedRateHourly condition is \(editedRateHourly)") if editedRateHourly != ""{ …
1
vote
2 answers

Remove subview on viewdisappear add again when appear - not working- ios sdk

I am working with the application and want to remove table view when view disappear and want to add that same table view when view appear. Currently From A ctr(push) -> B ctr From B ctr(push) -> C ctr -- I removed tableview in B ctr from…
Satish
  • 1,012
  • 2
  • 15
  • 32
1
vote
1 answer

crash with ios8, popToViewController and UIViewControllerHierarchyInconsistency

Everything was fine with iOS7 and Xcode and 5 - and after the upgrade to Xcode 6 and so iOS8, there is a sudden crash in the application where it was always working fine. The error shown when it crashes is: Terminating app due to uncaught…
geebee
  • 131
  • 1
  • 11
1
vote
2 answers

iOS7 - popToRootViewControllerAnimated not doing anything

I have looked around but haven't found a satisfying answer. My problem is that whenever I call popToRootViewControllerAnimated:(BOOL) it is not doing anything. When I NSLog it, it logs (null). Let me back up a bit here. I have a table view…
suntzu
  • 65
  • 3
  • 13
1
vote
2 answers

pop To View Controller

I am new to coding objective-C and am trying to use pop to viewController. To do this when a button is tapped i use [self.navigationController popToViewController:(what goes here) animated:YES]; I know its a UIViewController* that goes there but I…
1
vote
1 answer

Presenting another view controller that's not a parent

In a storyboard I have 3 view controllers: firstViewController, secondViewController, and controllerA. Both firstViewController and secondViewController have a navigation right bar item that presents controllerA using segues in storyboard.…