を読み込もうとしていますがUIWebView
、なぜうまくいかないのか理解できません。私はこれをやっています:
Loading *load = [[Loading alloc] init];
[load searchName];
その後 Loading.h
@interface Loading : NSObject <UIWebViewDelegate>
{
UIWebView *myWebView;
}
- (void) searchName;
Loading.m
- (void) searchName{
myWebView = [[UIWebView alloc] init];
myWebView.delegate = self;
NSString *urlAddress = @"www.google.com";
//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[myWebView loadRequest:requestObj];
}
- (void)webViewDidFinishLoad:(UIWebView *)thisWebView
{
NSString *yourHTMLSourceCodeString = [myWebView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];
NSLog(@"%@",yourHTMLSourceCodeString);
}
webViewDidFinishLoad
メソッドを呼び出さないのはなぜですか?