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시장이 얼마나 커질까?

 말도 안되는 규모로 테슬라, 메타, OpenAI의 스타게이트 연합군에서 짓고 있는 데이터 센터들입니다.  1기가와트, 2기가와트, 5기가와트 ㅎㅎ  앞으로 세상이 정말 더 많이 변할 것 같습니다. 저는 하드웨어를 직접 다루지 않기 때문에 IDC센터를...