title: Create UIWebView programmatically
body: <p>I've been trying this for a while, but I'm not getting it right.</p>
  
  <p>I have written the following init function in a supporting file:</p>
  
  <pre><code>- (id)initWithFrame:(CGRect)frame
   {
      self = [super initWithFrame:frame];
      if (self) {
      webview=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 1024,768)];
   }
      return self;
  }
  </code></pre>
  
  <p>and following in ViewController.m</p>
  
  <pre><code>- (void)viewDidLoad
  {
     [super viewDidLoad];
  
     UIWebView *view = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
     NSString *url=@"http://www.google.com";
     NSURL *nsurl=[NSURL URLWithString:url];
     NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];
     [view loadRequest:nsrequest]; 
  }
  </code></pre>
  
  <p>I also tried creating the webview in <code>didFinishLaunchingWithOptions:</code> method of appDelegate, but it also didn't work.</p>
  
  <p>What is the correct way?</p>