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

댓글 없음:

댓글 쓰기

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

Xcode 26의 새로운 기능들

 애플의 AI준비에 대한 골든타임이 지나가고 있다는 말이 많이 들립니다. ㅎㅎ  애플의 그동안의 패쇄적인 환경을 생각하면 온디바이스AI나 LLM환경에서 다소 아쉬운 부분이 많이 있습니다. 다른 빅테크들과 전혀 다른 방향의 목소리를 내고 있어서 좀 우려...