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

  • SEARCH
  • Home
  • 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 8496021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:44:07+00:00 2026-06-10T23:44:07+00:00

Okay. If you have two viewControllers and you do a modal Segue from the

  • 0

Okay. If you have two viewControllers and you do a modal Segue from the first to the second, then you dismiss it with [self dismissModalViewControllerAnimated:YES]; it doesn’t seem to recall viewDidLoad. I have a main page (viewController), then a options page of sorts and I want the main page to update when you change an option. This worked when I just did a two modal segues (one going forward, one going back), but that seemed unstructured and may lead to messy code in larger projects.

I have heard of push segues. Are they any better?

Thanks. I appreciate any help :).

  • 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-10T23:44:09+00:00Added an answer on June 10, 2026 at 11:44 pm

    That’s because the UIViewController is already loaded in memory. You can however use viewDidAppear:.

    Alternatively, you can make the pushing view controller a delegate of the pushed view controller, and notify it of the updates when the pushed controller is exiting the screen.

    The latter method has the benefit of not needing to re-run the entire body of viewDidAppear:. If you’re only updating a table row, for example, why re-render the whole thing?

    EDIT: Just for you, here is a quick example of using delegates:

    #import <Foundation/Foundation.h>
    
    // this would be in your ModalView Controller's .h
    @class ModalView;
    
    @protocol ModalViewDelegate
    
    - (void)modalViewSaveButtonWasTapped:(ModalView *)modalView;
    
    @end
    
    @interface ModalView : NSObject
    
    @property (nonatomic, retain) id delegate;
    
    @end
    
    // this is in your ModalView Controller's .m
    @implementation ModalView
    
    @synthesize delegate;
    
    - (void)didTapSaveButton
    {
        NSLog(@"Saving data, alerting delegate, maybe");
    
        if( self.delegate && [self.delegate respondsToSelector:@selector(modalViewSaveButtonWasTapped:)])
        {
            NSLog(@"Indeed alerting delegate");
    
            [self.delegate modalViewSaveButtonWasTapped:self];
        }
    }
    
    @end
    
    // this would be your pushing View Controller's .h
    @interface ViewController : NSObject <ModalViewDelegate>
    
    - (void)prepareForSegue;
    
    @end;
    
    // this would be your pushing View Controller's .m
    @implementation ViewController
    
    - (void)prepareForSegue
    {
        ModalView *v = [[ModalView alloc] init];
    
        // note we tell the pushed view that the pushing view is the delegate
        v.delegate = self;
    
        // push it
    
        // this would be called by the UI
        [v didTapSaveButton];
    }
    
    - (void)modalViewSaveButtonWasTapped:(ModalView *)modalView
    {
        NSLog(@"In the delegate method");
    }
    
    @end
    
    int main(int argc, char *argv[]) {
        @autoreleasepool {
    
            ViewController *v = [[ViewController alloc] init];
    
            [v prepareForSegue];
        }
    }
    

    Outputs:

    2012-08-30 10:55:42.061 Untitled[2239:707] Saving data, alerting delegate, maybe
    2012-08-30 10:55:42.064 Untitled[2239:707] Indeed alerting delegate
    2012-08-30 10:55:42.064 Untitled[2239:707] In the delegate method
    

    Example was ran in CodeRunner for OS X, whom I have zero affiliation with.

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

Sidebar

Related Questions

Okay, I have two Regex patterns. ([a-zA-Z0-9]?http[s]?:\/\/)?((?:(?:\w+)\.)(?:\S+)(?:\.(?:\w+))+?) [a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,6} The first meets my needs at
I have a two part question. The first I think I have an okay
Okay so I have two import pieces of code involved in this. This first
Okay i have two models: posts and comments. as you can think comments has
Okay, I have two OperationContracts and MessageContracts, like this: [OperationContract] OperationResult OperationOnSingleItem(Input input) [OperationContract]
Okay I have two classes for two links and two divs with different information.
okay so I have two projects one in which I have done all the
Okay, so here's the issue. I have two apps that need to package up
I have two methods that do the same thing. The first one makes performance
okay so I have two arrays $array_one([a]=>2,[b]=>1,[c]=>1); $array_two([a]=>1,[b]=>2,[c]=>1); I want to be able to

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.