Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:06:28+00:00 2026-06-14T04:06:28+00:00

Currently, my app goes from view A to view B through a segue and

  • 0

Currently, my app goes from view A to view B through a segue and performs some functions in prepareForSegue. What should I do if I want to call a function that is executed when view B goes to view A (after pressing the back button on the Navigation Controller)?

I imagine that I could map the “back button” to an IBAction, but I’m not sure how I would do that, since the back button is part of the Navigation Controller and isn’t directly visible on the Storyboard.

In particular, view B updates some values that view A has displayed. I want to call viewDidLoad so that view A has the updated data before it loads.

In ViewA’s view controller:

// update view when it becomes visible
- (void)viewDidAppear:(BOOL)animated {
    [self viewDidLoad];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:06:30+00:00Added an answer on June 14, 2026 at 4:06 am

    Ah, this isn’t a segue as such. This is equivalent to popViewController.

    If you want to update the view when view A becomes visible then you can do that in the function…

    - (void)viewWillAppear:(BOOL)animated
    

    or in the function

    - (void)viewDidAppear:(BOOL)animated
    

    These will run each time the view becomes visible.

    In here you can run your “updateView” method or whatever method you want.

    If you want to pass data back to view A (i.e. view B is a “select city” view or something) then you show make view A a delegate of view B. That way you can pass the info back when the user does something.

    Instead of running viewDidLoad do this…

    - (void)viewDidLoad
    {
        [self.button setTitle:@"blah"];
    
        [self updateView];
    }
    
    - (void)viewDidAppear:(BOOL)animated
    {
        [self updateView];
    }
    
    - (void)updateView
    {
        // do something that you want to happen
    }
    

    You shouldn’t actually have to do this though. It is enough just to run [self updateView] from viewDidAppear.

    You can’t run viewDidLoad directly though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to upload some files which should continue even if the application goes
I currently have a app on the market it saves some data with onRetainNonConfigurationInstance
I'm currently migrating my app from using ASIHTTPRequest to AFNetworking. I know synchronous requests
I need to deploy this app and currently the installer the path goes something
I currently use Com4j to talk to iTunes from my Java app, unfortunately it
My app currently uses OAuth to communicate with the Twitter API. Back in December,
Possible Duplicate: Programmatically delete my own app Currently I am working on a iphone
I need to know which iOS device is currently running app (saying more exactly
Currently building an app that runs on mobile phones not related to the issue
I currently have an app published on the App Store but I've just updated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.