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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:08:49+00:00 2026-06-04T04:08:49+00:00

I have some code that shows two UIViewController in a delegate. RootViewController.m request =

  • 0

I have some code that shows two UIViewController in a delegate.

RootViewController.m

request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"***some https url here ***"]];
// custom implementation of NSURLConnectionDelegate
dataman = [[DataManager alloc] initWithParentcontroller:self]; 
mainConn = [[NSURLConnection alloc] initWithRequest:request delegate:dataman]; 

In AuthenticationViewController.h

@protocol ShowAuthenticationWindowDelegate <NSObject>
@required
- (void) onFinishedEnteringCredentials:(NSURLCredential*)credentials;
- (void) onCancelAuthentication;
@end

in AuthenticationViewController.m

- (IBAction) onClickLogin:(id)sender;
{
    ....
    // authDelegate => id <ShowAuthenticationWindowDelegate>
    [authDelegate onFinishedEnteringCredentials:credentials];
    [self dismissModalViewControllerAnimated:YES];
    ....
}

in DataManger.h (DataManager class) implements the NSURLConnectionDelegate and ShowAuthenticationWindowDelegate.

In Datamanager.m
In the didReceiveAuthenticationChallenge delegate function I show the AuthentiationViewController as a modal dialog to gather username/password.

-(void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
    AuthenticationViewController *authview = [[AuthenticationViewController alloc] initWithNibName:@"AuthenticationViewController" bundle:[NSBundle mainBundle]];
    authview.modalPresentationStyle = UIModalPresentationFullScreen;
    authview.modalTransitionStyle   = UIModalTransitionStyleFlipHorizontal;
    authview.credentialsDelegate = self;
    [rootController presentModalViewController:authview animated:YES];
} 

Here I show a UIViewController which is an activity indicator in a view. I am showing it modally after I dismiss the previous AuthenticationViewController dialog in one of the login button event handler by called dismissModalViewController. After sending the credentials with challenge object (previously cached) I am showing the ActivityViewController modally, but it is not shown no matter what I do. I tried to show an UIAlertView which works, but my activityviewcontroller is not shown. I checked the parameters and objects everything is valid. even the delegate wire ups!!! All the code is getting called but the dialog is not shown.

May be I am missing something ???

- (void) onFinishedEnteringCredentials:(NSURLCredential*)credentials;
{

    [[authChallenge sender] useCredential:credentials forAuthenticationChallenge:authChallenge];
    // create an activity modal dialog 
    if (activityController == nil) {
        activityController = [[ActivityViewController alloc] initWithNibName:@"ActivityViewController" bundle:[NSBundle mainBundle]];
        activityController.modalPresentationStyle = UIModalPresentationFullScreen;
        activityController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    }
    [rootController presentModalViewController:activityController animated:YES];
}
  • 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-04T04:08:51+00:00Added an answer on June 4, 2026 at 4:08 am

    I have figure out the solution, if anyone want to show two modal dialogs back to back, you should set the “animated” parameter to “NO” on the controller that is being dismissed. It seems like the animation transition is not being completed by the time the next controller is shown with “presentViewController” function.

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

Sidebar

Related Questions

I have some code that looks like this (I left out the parts that
i have some code that tries to list images based on their height. the
I have some code that creates a new event source: EventLog.CreateEventSource(Source, LogName); I know
I have some code that gives a user id to a utility that then
I have some code that uses the shared gateway pattern to implement an inversion
I have some code that raises PropertyChanged events and I would like to be
I have some code that looks like: template<unsigned int A, unsigned int B> int
I have some code that generates image of a pie chart. It's a general
I have some code that effectively does this : File file = new File(C:\\Program
I have some code that I am putting in the code-behind of a master

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.