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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:24:14+00:00 2026-06-12T10:24:14+00:00

I have a UIViewController inside of which I put a UIWebView Then I added

  • 0

I have a UIViewController inside of which I put a UIWebView

Then I added this to the .h file:

#import <UIKit/UIKit.h>

@interface BuildBusinessController : UIViewController
@property (weak, nonatomic) IBOutlet UIWebView *theWebView;

@end

and have this as the .m file

#import "BuildBusinessController.h"

@interface BuildBusinessController ()

@end

@implementation BuildBusinessController
@synthesize theWebView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    theWebView.delegate = self;
}

- (void)viewDidUnload
{
    [self setTheWebView:nil];
    [super viewDidUnload];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}


- (void)viewDidAppear:(BOOL)animated
{  
    NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"build_business" ofType:@"html"];
    NSURL *url = [NSURL fileURLWithPath:htmlFile];
    NSURLRequest *rq = [NSURLRequest requestWithURL:url];
    [theWebView loadRequest:rq];
}

@end

But the build_business.html file is not rendering inside the view, and also I get a warning on this line: theWebView.delegate = self; which says:

Assigning to id ‘UIWebViewDelegate from incompatible type BuildBusinessController *const_string

Would anyone know what I am doing wrong here? It feels I am forgetting some one small thing 🙂

  • 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-12T10:24:16+00:00Added an answer on June 12, 2026 at 10:24 am

    In addition to F.X. answer, I think you forgot to add this in viewDidAppear (after loadRequest):

    [self.view addSubview:theWebView];
    

    Update: The issue is caused by OP failing to configure delegate for UIWebView in Storyboard. The code snippet provided here will only work if you are coding it manually. Otherwise, as stated by @F.X. in the comments below, Storyboard will implement this automatically.

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

Sidebar

Related Questions

I have a UIViewController (which sits inside a tabUIController). Within this UIViewController, I want
Inside Interface Builder I have a UINavigationController, which contains a UIViewController, which has a
I have a UIViewController which is a UIWebViewDelegate and has a UIWebView inside of
I have one UIViewController (DownloadManager) which downloads a webpage with UIWebView and display the
So I have a UIScrollView inside a UIView of a UIViewController in which I
I have a bunch of horizontal UITableView which is put inside a UIViewController1. I
I have a custom UIView which gets loaded through a NIB inside a UIViewController.
I have a UITableView inside a UIViewController like so: .h @interface OutageListViewController : UIViewController<UITableViewDelegate,UITableViewDataSource>
I have put an UITableView inside a UIViewController and have copied code from UITableViewController
So I have a UIView which I call ctrView and this ctrView is added

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.