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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:18:21+00:00 2026-06-05T21:18:21+00:00

I am making an application using two view controlers. When I am working on

  • 0

I am making an application using two view controlers. When I am working on my first view I have posibility to go to another view using button “Settings” and method conected to this button looks like this:

-(IBAction)Settings:(id)sender{

[self presentModalViewController:settingsHandle animated:YES];

settingsHandle is an object of a second view class which is alloceted when the first view is loaded.

My problem starts while I am in a second view and i call method which include NSTimer object. This method is working during hmmm lets say 30 sec but it also can be 5 min, the result of this method is calling onother view the 3rd one.

Everything goes fine while am waiting for the result of this function in a second view.The result is that i am in a 3rd view.

When, during the method is working I am going to the first view from the second (using [self dismissModalViewControllerAnimated:YES]; )I can see that the method has finished(using NSLOG) but [self presentModalViewController:thirdview animated:YES]; is not working, just nothing happens.

so to sum up:

Waiting for the result in a secodnview (Succes third view uploaded)
Waiting for the result in a firstview (fail nothing happens)

And my goal is to make it happens from the firstview!

  • 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-05T21:18:23+00:00Added an answer on June 5, 2026 at 9:18 pm

    You can’t present a ModalViewController from a ViewController that is dismissed. So, you need to keep track of the visible ViewController and call presentModalViewController from there. In your scenario, the easiest solution would be to make your NSTimer invoke a method in your first ViewController which goes like this

    - (void)presentViewController:(NSTimer *)timer
    {
        if(self.modalViewController == nil)
            [self presentModalViewController:settingsHandle animated:YES];
        else
            [self.modalViewController presentViewController];
    }
    

    If you create the NSTimer in your 2. ViewController, you would of course need a reference to the first ViewController. You could just pass this reference like this

    -(IBAction)Settings:(id)sender{
        settingsHandle.myParentViewController = self; //You need to create this var in settingsHandle
        [self presentModalViewController:settingsHandle animated:YES];
        //...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a RIA application using Silverlight and web services. The method of
I am making an application i have to compare two strings for a specific
I really have a strange situation. I'm making a Linux multi-threaded C application using
I'm making an android application using phonegap. I'm using phonegap's Storage api for querying
Using J2SE, I tried making a LAN application using java.net.*, and it worked perfectly.
I am making a test fullscreen application using this guide . However, I am
I'm using C# and I'm making an application where a lot of UI loading
Lately I've been making a new application and I'm using a ton of forms.
I'm making a simple game using the Windows Phone Silverlight and XNA Application type
As a personal project, I'm making an AJAX chatroom application using XML as a

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.