2014년 11월 16일 일요일

아이폰 - 로컬에 있는 HTML 파일을 웹뷰에 출력하는 데모

아이폰 - 로컬에 있는 HTML 파일을 웹뷰에 출력하는 데모 조회 : 203
나의 폴더 > 아이폰 | 2012-12-13 (Thu) 14:04http://blog.dreamwiz.com/papasmf1/13911354
//
//  ViewController.h
//  demoWebView
//
//  Created by JONG DUK KIM on 12. 12. 12..
//  Copyright (c) 2012 JONG DUK KIM. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

@property (strongnonatomicIBOutlet UIWebView *webView;

-(IBAction)goToHTML:(id)sender;

@end

//
//  ViewController.m
//  demoWebView
//
//  Created by JONG DUK KIM on 12. 12. 12..
//  Copyright (c) 2012 JONG DUK KIM. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController
@synthesize webView;

-(IBAction)goToHTML:(id)sender
{
    //웹뷰로 html페이지를 로딩하는 코드
    //test1.html파일이면 아래와 같이 파일명을 기술해 주면
    //로딩된다
    NSError *error = nil;
    NSString *html = [[NSString alloc]
            initWithContentsOfFile:[[NSBundle mainBundle]
            pathForResource:@"test1" ofType:@"html"encoding:NSUTF8StringEncoding error:&error];
    [webView loadHTMLString:html baseURL:[NSURL URLWithString:[[NSBundle mainBundlepathForResource:@"test1" ofType:@"html"]]];
    
}

- (void)viewDidLoad
{
    [super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

댓글 없음:

댓글 쓰기

참고: 블로그의 회원만 댓글을 작성할 수 있습니다.

제 AI는 스스로 생각하고 학습한다.. 난리난 AI 에이전트 직접 확인해보니 - 영상정리해 봅니다.

  ChatGPT가 나온지 3년이 넘었습니다. ㅎㅎ 처음에는 생성형AI에서 LLM으로 시장이 변화되었습니다. 작년말부터는 에이전트의 시대라고 하고 있습니다. 저도 관련 강의를 하고 일을 하고 있지만 따라가기가 벅찰정도로 매주 새로운 소식들이 올라옵니다...