Reputation: 2270
I have an UIWebView which added as subview into my view controller's view. When the user enter username and password, login service will be called from the web service.
The response is received successfully in UIWebview
1. Is it possible to get the response from UIWebview to my application?
2. How can the response be accessed from my application?
Upvotes: 2
Views: 1848
Reputation: 11201
In the delegate method:, you can get the html content of your webview using the below code.
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
NSString *html = [webView stringByEvaluatingJavaScriptFromString:
@"document.body.innerHTML"];
}
If you are using NSURLConnection then the response can be captured in the following delegate method:
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
Upvotes: 2