[iPhone] WebView 관련

개발과삶 2008/10/24 09:15 Posted by 종이비행기
HTML 파일을 읽어서 WebView로 출력
    webView.userInteractionEnabled = true;
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]; 
    NSData* htmlData = [NSData dataWithContentsOfFile:filePath]; 
    [webView loadData:htmlData MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:@"http://www.pcraft.kr/index.html"]];     

WebView 웹사이트 로딩
     webView.userInteractionEnabled = true;
     [webView loadRequest:[[NSURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:@"http://www.google.com"]]];