Contents

Develop
2015.02.10 18:01

[ios] 로컬에 있는 html 실행하기

조회 수 2181 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

HTML 파일을 리소스로 두고 웹뷰에서 읽어서 로드하기.

// Load the html as a string from the file system
NSString *path = [[NSBundle mainBundle]
    pathForResource:@"index" ofType:@"html"];

NSString *html = [[NSString alloc] initWithContentsOfFile:path
    encoding:NSUTF8StringEncoding error:nil];

// Tell the web view to load it
[WebView loadHTMLString:html
    baseURL:[[NSBundle mainBundle] bundleURL]];


[출처] http://stackoverflow.com/questions/4645414/how-can-i-load-a-local-html-file-into-the-uiwebview


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
601 Develop [c++] 채팅로봇 소스.. ㅋㄷㅋㄷ file hooni 2013.04.23 9788
600 Develop [c] 지나가는 패킷 잡기 hooni 2003.04.23 9772
599 Develop [c] fgets() 함수 사용하기.. hooni 2003.04.23 9745
598 Develop [c] 압축 알고리즘 소스 및 정리 file hooni 2013.04.23 9729
597 Develop [c] 레포트용으로 제출했던 여러 소스코드 모음 file hooni 2003.04.23 9725
596 Develop [c] 숫자(int, Number)를 hex코드로 변환하는 소스 file hooni 2013.04.23 9723
595 Develop [js] 스크롤을 포함한 마우스 위치 찾는 코드 hooni 2003.04.23 9723
594 Develop [c++] 레지스트리 등록 예제 1 file hooni 2013.04.23 9721
593 Develop [c] UCP/TCP 채팅 소스 - 정리해야 함.. file hooni 2003.04.23 9720
592 Develop [js] 초간단 암호화/복호화 소스.. hooni 2003.04.23 9718
591 Develop [php] php+db 연동(odbc, mssql, mysql, sybase) 3 hooni 2013.04.23 9692
590 Develop [css] 화면 스크롤 제어 ㅋㅋ hooni 2003.04.23 9688
Board Pagination Prev 1 ... 44 45 46 47 48 49 50 51 52 53 ... 99 Next
/ 99