iphone - UIWebView webViewDidStartLoad is called with request which properties are null -
i debugging uiwebview in order information improve performance (on server , iphone). noticed after calling loadrequest: callback
- (void)webviewdidstartload:(uiwebview *)webview_
is called, each parameter of request null.
i using following statement:
- (void)webviewdidstartload:(uiwebview *)webview_{ nslog(@"%@ \t start request: %@ \n absolute: %@ \n method: %@ \n parameters: %@ \n port: %@ \n query: %@ \n header fields: %@ \n httpbody: %@ \n httpbodystream: %@", [nsdate date], [[webview_ request] maindocumenturl], [[[webview_ request] maindocumenturl] absolutestring], [[webview_ request] httpmethod], [[[webview_ request] maindocumenturl] parameterstring], [[[webview_ request] maindocumenturl] port], [[[webview_ request] maindocumenturl] query], [[webview_ request] allhttpheaderfields], [[webview_ request] httpbody], [[webview_ request] httpbodystream]); }
the output is:
2011-05-11 17:15:34 +0200 start request: (null) absolute: (null) method: parameters: (null) port: (null) query: (null) header fields: { } httpbody: (null) httpbodystream: (null)
is there explanation behavior or fix this?
the page loads fine, request loading nothing seems take 30 seconds try avoid.
edit: additional information loading webview. calling method adds webview uiview , loads url
uiwebview * web = [[uiwebview alloc] initwithframe:cgrectmake(indent, topindent+indent, screensize.width-2*indent, screensize.height-2*indent-topindent)]; web.delegate = self; [view addsubview:web]; nsurlrequest * someurl = [nsurlrequest requestwithurl:[nsurl urlwithstring: @"some_url"]]; [web loadrequest: someurl];
the reason you're not seeing request request property of webview isn't assigned until request has been loaded. show actual displayed request, after redirects. if want initial request object, before redirects etc, use toddh's answer. final request, have check in webviewdidfinishload.
Comments
Post a Comment