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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:02:20+00:00 2026-06-13T01:02:20+00:00

I have been working around one small project which needs a similar GUI as

  • 0

I have been working around one small project which needs a similar GUI as that of SplitViewController. Now what i have done is, I have two UIViewControllers namely MasterViewController and DetailViewController which are added as subview of ViewController
The code is shown below for ViewController.m

- (void)viewDidLoad
{  
   UIScreen *screen = [UIScreen mainScreen];
   CGRect fullScreenRect = screen.bounds; // always implicitly in Portrait orientation.
   width = fullScreenRect.size.width;
   height = fullScreenRect.size.height;
   detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
   masterViewController = [[[MasterViewController alloc]initWithNibName:@"MasterViewController" bundle:nil] autorelease];
   masterViewController.view.frame = CGRectMake(0, 0, 299, height);
   detailViewController.view.frame = CGRectMake(300, 0, width-300, height);

  [self.view addSubview:masterViewController.view];
  [self.view addSubview:detailViewController.view];
}

Now in the MasterViewController didLoad method i have added as a subview MasterTableViewController…

MasterTableViewController class looks like this…

   @interface MasterTableViewController : UITableViewController 
   {
     DetailViewController *detailViewController;
   }

All the functions related to UITableViewController are already made… and i have also added the functionality to add URL from user and store it in the MasterTableView.
Now in the following function I am trying to call loadWebView function of DetailViewController with the required string. The call is made perfectly to the function.

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 {
   NSString *urlString = [_objects objectAtIndex:indexPath.row];
   detailViewController = [[DetailViewController alloc]init];
   [detailViewController loadWebView:urlString];
 }

In the loadWebView method of DetailViewController i have the following implementation..

 -(void) loadWebView: (NSString *) urlToLoad
 {
   self.webView = [[[UIWebView alloc]
                 initWithFrame:CGRectMake(0, 45, self.view.frame.size.width, self.view.frame.size.height)] autorelease];
   [self.webView setDelegate:self];

   NSLog(@"SELF->WEBVIEW: %@",self.webView);
   NSURL *url = [NSURL URLWithString:urlToLoad];
   NSLog(@"loading url %@ %@", urlToLoad, self.webView);
   NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

   [self.webView loadRequest:requestObj];
 }

I have also implemented the following function just to make sure that my Webview is working..

 - (void)webViewDidStartLoad:(UIWebView *)webView
 {
    NSLog(@"webViewDidStartLoad");
 }
 - (void)webViewDidFinishLoad:(UIWebView *)webView
 {
    NSLog(@"webViewDidFinishLoad");
 }

Now when i run my program the log prints all these things…

 2012-10-15 20:04:21.621 SyneBlogApp[2320:c07] device width height 768.000000 1024.000000
 2012-10-15 20:04:21.630 SyneBlogApp[2320:c07] calling viewDidLoad for detailView
 2012-10-15 20:04:21.636 SyneBlogApp[2320:c07] /Users/Library/Application Support/iPhone Simulator/5.1/Applications/B846EDA4-49CF-4DD3-AAB3-FF8BC19C65DA/Documents/Data.plist: 
 2012-10-15 20:04:22.942 SyneBlogApp[2320:c07] calling viewDidLoad for detailView
 2012-10-15 20:04:22.954 SyneBlogApp[2320:c07] SELF>WEBVIEW: <UIWebView: 0x6a94510; frame = (0 45; 768 1004); layer = <CALayer: 0x6a94930>>
 2012-10-15 20:04:22.955 SyneBlogApp[2320:c07] loading url http://wordpress.com   <UIWebView: 0x6a94510; frame = (0 45; 768 1004); layer = <CALayer: 0x6a94930>>
 2012-10-15 20:04:22.994 SyneBlogApp[2320:c07] webViewDidStartLoad
 2012-10-15 20:04:26.828 SyneBlogApp[2320:c07] webViewDidFinishLoad

According to log my webview loads the data perfectly, but when i have a look at the emulator i get a white screen. That is the content is not shown up…

Now just to make sure that nothing is wrong with webview i tried in DetailViewController viewDiDloadMethod the following which works and shows up the google page…

  - (void)viewDidLoad
  {
    self.webView = [[[UIWebView alloc]
                 initWithFrame:CGRectMake(0, 45, self.view.frame.size.width,    self.view.frame.size.height)] autorelease];
    NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

   [self.webView loadRequest:requestObj];
   [self.view addSubview:self.webView];
   [super viewDidLoad];
   NSLog(@"calling viewDidLoad for detailView");
  }

Now I seriously have no idea of what is going wrong. Even after all the things are working up well in log still the webpage content is not shown up.. Guys if you have any clue of what is going wrong please help…

  • 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-13T01:02:21+00:00Added an answer on June 13, 2026 at 1:02 am

    This…

       detailViewController = [[DetailViewController alloc]init];
    

    …creates a new DetailViewController instead of using the one you already created and made part of your display in the first code segment you showed. You are therefore loading up your web view for a controller/view that isn’t on screen.

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

Sidebar

Related Questions

I have been working on a small hack around with Power Point to automatically
I have been working with SQL Server as a Developer a while. One thing
I have been working on a project in C# (.net4). Project pretty much allows
I have been working on a project on and off, but I haven't touched
I have been working with Zend for a few months now and am at
I have been working on a huge ETL project with 150+ tables and during
I have been working with NSArray s and NSMutableArray s that store NSDate objects
I have been working around in UIImagePickerController and am struck with a problem where
I have been working with C++ and Win32 (non MFC/ATL) I am playing around
Unfortunately I've got a bug that I have been working on for 1 full

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.