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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:48:34+00:00 2026-06-06T07:48:34+00:00

I have one UIViewController (DownloadManager) which downloads a webpage with UIWebView and display the

  • 0

I have one UIViewController (DownloadManager) which downloads a webpage with UIWebView and display the downloaded content (say a pdf file). I want to use it as reusable component.

I am having another UIViewController pointing to a screen which contains 4 buttons each button should download and display one pdf file from webpage. I want to display the downloaded pdf as a embedded subview to the current screen. Basically don’t want navigation.

Here I tried to use DownloadManager as subview and display pdf as subview. Its working fine.

  1. I read as Per screen one View Controller. But still can I use this approach ?

  2. I have to send a email feedback from this screen. As soon as I present the MFMailComposeViewController the previous download manager subview disappears Technically what is happening here?

Please find the code snippet below:

//************************************************
@implement MyViewController

- (void) initWebView
{
    downloadMgr = [[DownLoadViewController alloc] initWithNibName:@"DownLoadViewController" bundle:nil];

    downloadMgr.view.frame = CGRectMake(140, 20, 300, 200);
    downloadMgr.WebView.frame = CGRectMake(140, 20, 300, 200);

    downloadMgr.view.backgroundColor = [UIColor whiteColor];
    downloadMgr.WebView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:downloadMgr.view];
    [self.view addSubview:downloadMgr.WebView];
}

----
----

- (IBAction)onHomeClick:(UIButton *)sender 
{
    switch (sender.tag) 
    {
        case 101: 
            {
                [self stopWebViewResources];
                if (!downloadMgr) {
                    [self initWebView];
                }
                downloadMgr.NavigationURL = [[NSURL alloc] initWithString:@"https://xxx.yyyyyy.com/sites/pex/iPadFiles/abc.pdf"];        
                downloadMgr.title = @"ABC";
                [downloadMgr LoadURL];
            }
            break;

case 120:
        {
            //Send feedback via email
            if ([MFMailComposeViewController canSendMail]) 
            {
                MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
                mail.mailComposeDelegate = self;

                ----
                ----

                mail.modalPresentationStyle = UIModalPresentationFullScreen;
                [self presentModalViewController:mail animated:YES];
            }
        }
    }
}

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{   
    [self dismissModalViewControllerAnimated:YES];
}

@end
//*****************************************************************


@interface DownLoadViewController : UIViewController <MyWebViewDelegate>{
    NSURL*                            NavigationURL;
    IBOutlet myWebView*              WebView;

    IBOutlet UIActivityIndicatorView* ProgressView;
        NSString*                         DownloadedFileName; 
}
  • 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-06T07:48:35+00:00Added an answer on June 6, 2026 at 7:48 am

    It is much more robust to separate the download functionality and the display into two different classes.

    Ideally, you should have a class like “Downloader” or “Download Manager” which is a subclass of NSObject. This class should do the download and notify its delegate when it is done. Then you can have as many UIViewControllers as you like that take advantage of your Downloader class.

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

Sidebar

Related Questions

I have created one application in which i want to display compass.but my application
I have a UIViewController one UIWebView in it. I'd like the UIWebView to be
In my app i have one UIViewController and there are many UIView which i
I have an application where I'm trying to pass a UIScrollView from one UIViewController
In one of my UIViewControllers , I have a UITableView , which only has
I have one XML request which I need to modify (to XML) and then
I have one drop down list in my page, which contains two options. What
In one UIViewController , I have a UISegmentedControl . When I select segmented control.selectedindex==0,
I have one tab bar controller to connect with 5 UIViewController. It was connected
I have a tricky question. As everyone knows, Apple clearly says that ONE UIViewController

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.