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 76643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:42:20+00:00 2026-05-10T20:42:20+00:00

I was kind of scratching my head at this a week ago, and now

  • 0

I was kind of scratching my head at this a week ago, and now with a little bit more Cocoa experience under my belt I feel like I have an inkling as to what might be going on.

I’m making an application that is driven by a UINavigationController. In the AppDelegate, I create an instance of this class, using ‘page 1’ as the Root View Controller.

UINavigationController *aNavigationController = [[UINavigationController alloc]       initWithRootViewController:page1ViewController]; 

Now here’s where I’m having the problem. From ‘page 1’ I’d like to use a modal view controller that slides over the interface and then disappears once the user has made an edit. I do that using code like this, inside of Page1ViewController:

[self presentModalViewController:myModalViewController animated:YES]; 

When the Modal View Controller is gone, I want a value on ‘Page 1’ to change based on what the user entered in the Modal View Controller. So, I wrote some code like this, which resides in the Modal View Controller:

[self.parentViewController dismissModalViewControllerAnimated:YES]; [self.parentViewController doSomethingPleaseWithSomeData:someData]; 

The update to page 1 wasn’t happening, and it took me a long time to realize that the ‘doSomethingPleaseWithSomeData’ message was not being sent to Page1ViewController, but the Navigation Controller.

Is this always to be expected when using Navigation Controllers? Did I perhaps configure something improperly? Is there an easy way to get at the View Controller that I want (in this case, Page1ViewController).

  • 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. 2026-05-10T20:42:21+00:00Added an answer on May 10, 2026 at 8:42 pm

    I would recommend using the delegation pattern to solve your problem. Create a property

    @property (nonatomic, assign) id <MyModalViewDelegate> delegate; 

    And a corresponding protocol

    @protocol MyModalViewDelegate @optional     - (void)myModalViewControllerDidFinish:(MyModalViewController *)aModalViewController; @end 

    When the user finishes with your view (e.g. taps the save button), send this message:

    if ([self.delegate respondsToSelector:@selector(myModalViewControllerDidFinish:)])     [self.delegate myModalViewControllerDidFinish:self]; 

    Now, set the delegate to the view controller that should manage the whole thing, and it will be notified when the view controller is finished. Note that you’ll need your view controller to dismiss the modal view controller. But, logically, that makes sense, since it was the object that presented the modal view controller in the first place.

    This is how Apple solves this problem in, for example, the UIImagePickerController and UIPersonPickerController.

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

Sidebar

Ask A Question

Stats

  • Questions 74k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer UIntPtr will work (IntPtr would probably work too, but size_t… May 11, 2026 at 2:19 pm
  • added an answer As you've still not had any responses... I haven't used… May 11, 2026 at 2:19 pm
  • added an answer Richard, we didn't want to put CruiseControl anywhere near staging… May 11, 2026 at 2:19 pm

Related Questions

A manager asked me to do some quick research on the possibility of doing
I was kind of shocked by this. Could someone explain why this works? A
This question was kind of touched before but not the answer I was looking
My JavaScript is pretty nominal, so when I saw this construction, I was kind

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.