poptoviewcontroller

viewWillAppear not called after popToViewController

浪子不回头ぞ 提交于 2021-01-28 21:39:59
问题 I have a little problem. I am working on a simple application with Views Controllers in a Navigation Controller like this: A->B->C (-> are modal segues) View A is the Root View Controller and I need to come back to A from C. If I call the method popToViewController from B, A run the viewWillAppear; if I call the popToViewController from C (to A), viewWillAppear on A is not called. How can I solve this? (Working on Xcode7 and iOS 9) ViewController A #import "ViewControllerA.h" #import

Swift 3: popToViewController not working

走远了吗. 提交于 2020-01-23 01:35:33
问题 In my app I have three table view controllers and then potentially many UIViewControllers each of which has to lead back to the first table view controller if the user presses back at any point. I don't want the user to have to back through potentially hundreds of pages. This is what I amusing to determine if the user pressed the back button and it works the message is printed override func viewWillDisappear(_ animated: Bool) { if !movingForward { print("moving back") let startvc = self

Pass back data using [popviewcontroller], and reload data

微笑、不失礼 提交于 2019-12-22 01:12:22
问题 http://imgur.com/2lAJmVd In the picture provided above, shows three view controllers. Let's call the view controllers A , B , and C in the order they're displayed. View Controller A passes parsed jSON data by clicking on the table cell. This fills up the "total sales, discounts, etc." strings/labels inside of the View Controller B using a prepareForSegue method. This data is based on a start time/end time and the default parameter when performing the segue gives information from 8 AM to 10 PM

Poptorootviewcontroller with delay

这一生的挚爱 提交于 2019-12-12 04:53:12
问题 I have a method "test" that execute poptorootviewcontroller. I want to put some delay before the animation of poptorootviewcontroller. Here is my code : -(void)test{ [UIView animateWithDuration:5.0 delay: 2.5 options: UIViewAnimationOptionCurveEaseIn animations:^{ [self.navigationController popToRootViewControllerAnimated:NO]; } completion:nil]; } But it doesn't work. Any help? Thanks! 回答1: The code you posted is for performing an animation, not delaying. A good solution would be to use

Proper way to call popToViewController - iOS

╄→尐↘猪︶ㄣ 提交于 2019-12-12 02:28:54
问题 I am having an argument with my team member regarding popToViewController. For me best approach is Can i pop to Specific ViewController? But he think we should create a static instance of the viewController and then call -(void)takeToPreviousViewController { if([IVPreviousViewController sharedInstance]) { [self.navigationController popToViewController:[IVPreviousViewController sharedInstance] animated:YES]; } } I strongly appose this approach because we're creating a public method in

call popToRootViewController from another tab

半城伤御伤魂 提交于 2019-12-11 09:25:37
问题 I have tab bar with navigation controller app using storyboard , my purpose is to press a button in tab3 and in the background I want tab1 to "popToRootViewController" the button in tab3 viewcontroller: - (IBAction)Action:(id)sender { vc1 * first = [[vc1 alloc]init]; [first performSelector:@selector(popToRootViewController) withObject:Nil]; } the code in the tab1 viewcontroller -(void)popToRootViewController{ [self.navigationController popToRootViewControllerAnimated:NO]; NSLog(@

When using popToRootViewController I lose my navigation bar

拈花ヽ惹草 提交于 2019-12-10 18:21:19
问题 I have an iOS app where the main screen is a UICollectionViewController. When selecting an Item from the collection view the view is pushed to a detail view of the item. In the detail view I built a drawer/slider that moves out from the side. In order to get the view to look the way I wanted I hid the default navigation bar and inserted one via storyboards. I ran into an issue that when hiding the default navigation bar you lose the back button functionality that comes with using a navigation

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

风流意气都作罢 提交于 2019-12-08 00:27:34
问题 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 where an unwind segue method is called. In the unwind segue method I call the following. -(IBAction)endSettingsViaLogout:(UIStoryboardSegue *)segue { //[self performSegueWithIdentifier:@"mainToLoginSegue" sender:self]; [self.navigationController

Pass back data using [popviewcontroller], and reload data

送分小仙女□ 提交于 2019-12-04 22:02:47
http://imgur.com/2lAJmVd In the picture provided above, shows three view controllers. Let's call the view controllers A , B , and C in the order they're displayed. View Controller A passes parsed jSON data by clicking on the table cell. This fills up the "total sales, discounts, etc." strings/labels inside of the View Controller B using a prepareForSegue method. This data is based on a start time/end time and the default parameter when performing the segue gives information from 8 AM to 10 PM of the current day. The parsing string looks like this NSDate *currentDate = [NSDate date];