Snippet

  1. - (void) displayUrlInWebView
  2. {
  3.         CGRect rect = [[UIScreen mainScreen] bounds];
  4.         CGSize screenSize = rect.size;
  5.        
  6.         UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,screenSize.width,screenSize.height)];
  7.         webView.autoresizesSubviews = YES;
  8.         webView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
  9.        
  10.        
  11.         NSURL *url = [NSURL URLWithString:@"http://www.justsikh.com/files/hukamnama.pdf"];
  12.         NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
  13.        
  14.         [webView loadRequest:urlRequest];
  15.        
  16.         [window addSubview:webView];
  17.         [webView release];
  18.        
  19. }