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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:43:03+00:00 2026-05-27T06:43:03+00:00

In my iPhone app, I’m presenting a modal view controller from a home screen

  • 0

In my iPhone app, I’m presenting a modal view controller from a home screen with a UIWebView that displays an “inline” embedded YouTube video using this:

UIWebView *youTubeWV = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 220)];
        [youTubeWV loadRequest:[NSURLRequest requestWithURL:sourceURL]];
        //NSString *youTubeVideoHTML = [NSString stringWithFormat:@"<embed id=\"yt\" src=\"http://www.youtube.com/watch?v=CadgUJRZfEE\" type=\"application/x-shockwave-flash\" width=\"320\" height=\"220\"></embed>"];
        NSString *youTubeVideoHTML =@"<html><head>"
        "<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 220\"/></head>"
        "<body style=\"background:#FFFFF;margin-top:0px;margin-left:0px\">"
        "<div><object width=\"320\" height=\"220\">"
        "<param name=\"wmode\" value=\"transparent\"></param>"
        "<embed src=\"http://www.youtube.com/v/W-nzUoaI2Ss?f=user_favorites&app=youtube_gdata\""
        "type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"320\" height=\"220\"></embed>"
        "</object></div></body></html>";
        [youTubeWV loadHTMLString:youTubeVideoHTML baseURL:nil];
        [self.view addSubview:youTubeWV];

The video is displayed without problem in the modal view “quicktime player” that shows. However, when I tap “Done” to close the second modal, I get kicked back to the very first screen, bypassing my first modal view. And in my home screen, now all the buttons don’t work. Strange!

UPDATE: I removed the modal transition from my home screen and made it a “pushViewController” instead, and now everything functions properly. So it’s an issue of the YouTube player dismiss 2 modals at the same time. How can this be fixed?

Any ideas?

  • 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-27T06:43:04+00:00Added an answer on May 27, 2026 at 6:43 am

    I’m not sure but it seems that after the “done” button is pressed and the Player is closed the control returns to the root view controller, in your case that’s your first screen.

    For exaple in my application I have an UITabBarController as my rootViewController, in my AppDelegate I have something like this:

    self.window.rootViewController = self.myTabBarController;
    

    So that’s the reason why my tabBarController (my first screen) always was presented after pressing the “done” button.

    I solved this setting my Modal View as my rootViewController after presenting it.

    Try this after presenting your modal view:

    MyAppDelegate *appDelegate = (MyAppDelegate *) [[UIApplication sharedApplication] delegate];
    [self presentModalViewController: myModalViewController animated: YES];
    [self.appDelegate.window setRootViewController: myModalViewController];
    

    NOTE: After dismissing the modal view you must restore the root view controller doing

    In my case:

    self.appDelegate.rootViewController = self.appDelegate.myTabBarController;
    

    Hope it helps

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

Sidebar

Related Questions

The iPhone app that I released is a wireless game controller, it translates touches
I am building an iphone app that reads a phone number from the address
My iPhone app has a tab bar controller at the bottom of the view
My iPhone app has a UIWebView that loads a page containing javascript that sets
The iPhone app that I am working on requires GET calls to a 3rd
My iPhone app formats an NSDecimalNumber as a currency using setCurrencyCode, however another screen
When I load my iPhone app it always loads a black screen first then
My iPhone app relies on a vendor's XML feed to provide data. But that
My iphone app downloads user specific data from our web server. How can I
the iphone app I am writing shows white screen when first launched, but become

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.