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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:38:35+00:00 2026-06-05T09:38:35+00:00

In viewDidLoad , I’m using NSURLRequest and NSURLConnection : NSURLRequest *site_request = [NSURLRequest requestWithURL:[NSURL

  • 0

In viewDidLoad, I’m using NSURLRequest and NSURLConnection:

NSURLRequest *site_request = 
    [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com/"] 
                     cachePolicy:NSURLRequestUseProtocolCachePolicy 
                 timeoutInterval:10.0];

NSURLConnection *site_connection = 
    [[NSURLConnection alloc] initWithRequest:site_request delegate:self];

and then I use

-(void)connection:(NSURLConnection *)site_connection didReceiveData:(NSData *)data 
{    
    site_response = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}

and I have the whole HTML in site_response.

I want to create an invisible UIWebView which will “open” the page from the NSURLRequest in order to use JavaScript to get content like this:

NSString *myText = [my_webView stringByEvaluatingJavaScriptFromString:
                       @"document.documentElement......"];

In my .h I have:

UIWebView *my_webview;
@property (nonatomic, retain) UIWebView *my_webview;

and in my .m I have:

@synthesize torrents_webview;

My viewDidLoad after NSURLRequest has

[my_webview loadRequest:site_request];

and I use

-(void)webViewDidFinishLoad:(UIWebView *)webView 
{
    //an alertview here
}

in order to be sure it works. But nothing happens. It doesn’t give an alert view.

What am I doing wrong?

  • 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-05T09:38:36+00:00Added an answer on June 5, 2026 at 9:38 am

    webViewDidFinishLoad: is a method of the UIWebView delegate. You are not setting the delegate anywhere in the code you have shown.

    @interface YourClass : UIViewController <UIWebViewDelegate>
    
    ...
    
    - (void)loadView
    {
        self.webView.delegate = self;
    }
    
    
    ...
    - (void)dealloc
    {
        self.webView.delegate = nil;
    }
    

    Also if you use NSURLRequest you’re going to get the page again. But there’s no need to use NSURLConnection, just go straight to loading the UIWebVIew using the NSURLRequest.

    Or if you must use NSURLConnection then when the file has downloaded save it to disk and use LoadHTMLString to load the contents.

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

Sidebar

Related Questions

- (void)viewDidLoad { [super viewDidLoad]; NSURL *url = [NSURL fileURLWithPath: [NSString stringWithFormat:@%@/Intro2.mp3, [[NSBundle mainBundle]
-viewDidLoad { tbl.rowHeight = 150; ary = [[NSArray alloc]initWithObjects:@asdf,@asd,nil]; ary2 = [[NSArray alloc]initWithObjects:@google,@yahoo,nil]; }
- (void)viewDidLoad { [super viewDidLoad]; ac = [[AddContacts alloc]init]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:ac];
- (void)viewDidLoad { webCollectionOnScroller=[[NSMutableArray alloc] init]; scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 370, 320, 94)];
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view
In my viewDidLoad method of my main View Controller I programatically create a segmented
Can I use viewDidLoad method in UITableviewCell ?
In my UIViewController's viewDidLoad method I instance a UIImageView instance called stage: stage =
i want to reload ViewdidLoad in a method But now want to call again
I used to addObserver in viewDidLoad: and removeObserver in dealloc: . Code: - (void)viewDidLoad

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.