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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:04:02+00:00 2026-05-24T04:04:02+00:00

My question is similar to: iPhone modal view inside another modal view? and Can

  • 0

My question is similar to: iPhone modal view inside another modal view? and Can I push a modal view controller from within another modal view controller?, however there is one difference:

None of my controllers are UINavigationControllers (i think thats what they are called).

So basically I have this:

RootView (variety of options such as submit expense, check calendar, etc) –> submit expense chosen and the following code is called:

EXP = [[ExpensesViewController alloc] initWithNibName:@"ExpensesViewController" bundle:nil];

    [self presentModalViewController:EXP animated:YES];

So now there is one modalview on top of the main view. Then within the expense modal view, I’d like to be able to choose a button that opens a modal view (in similar code)…

I understand from the two questions in my intro above that to do this basically it looks like this:

[controllerA presentModalViewController:Number2 animated:YES];

Could it look like this instead:

[self.view presentModalViewController:Number2 animated:YES];

because I don’t know how to reference the viewcontroller without creating a new instance of it.

Also, when it comes time to dismiss the second one so I can return to the first modal view (basically I open a modalview to submit an expense and then as part of the form, they must select a choice — for UI purposes a new modalview is the best. Once they decide on a choice, they return to the expense view by closing the extra detail modal view, to submit the expense and once they do, then that modal view closes).

So instead of using:

[self dismissModalViewControllerAnimated:YES];

would it be:

[self.view dismissModalViewControllerAnimated:YES];

??

Thanks guys:)

  • 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-05-24T04:04:02+00:00Added an answer on May 24, 2026 at 4:04 am

    Only UIViewController and subclasses thereof can present modal view controllers. self.view is a UIView instance and something completely different.

    In order to save yourself allot of work you should stick to two rules:

    1. Only present new modal view controllers from a view controller like so: [self presentModal…];.
    2. Only dismiss a modal view controller from the view controller being presented, like so: [self dismiss…];.

    This way you have a clear view of the ownership and responsibility of each view controller. Also the method I have seen pretty much everywhere top use [self.super dismiss…]; to dismiss a view controller will break on iOS 5.

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

Sidebar

Related Questions

Similar question , but this one is about Android. On the iPhone, there is
I have a question similar to the one here: Event handlers inside a Javascript
There are similar question, but not regarding C# libraries I can use in my
This is a question similar to a question here . I wonder is there
Similar question as this one but for a Microsoft Environment. Email --> Exchange Server
This question is similar to this other post , but I'm new to iPhone
my question is similar to this one: OpenCV: Detect blinking lights in a video
I know there's a similar question MPMusicPlayerController stops sending notifications , but the answer
(This question is similar to this one , but it's for using XMLHttpRequest instead
I'm having a problem similar to [this question][1] https://stackoverflow.com/questions/1449072/debugging-problem-in-x-code-iphone-development I have created an application,

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.