웹뷰로 pdf, txt, ppt 파일 열기
컴퓨터/아이폰 :
2011. 12. 15. 19:04
UIWebView *webView = [[UIWebView alloc] init];
//로컬 파일 가져온다
//NSString *FilePath = [[NSBundle mainBundle] pathForResource:@"PDF_test" ofType:@"pdf"];
//파일의 경로를 url로 사용
//NSURL *url = [NSURL fileURLWithPath:FilePath];
//url 주소로 가져온다
NSString *fileName = @"pdfFile.pdf";
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.###.com/%@", fileName]];
//url request object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
'컴퓨터 > 아이폰' 카테고리의 다른 글
UINavigationController Customization (title, background color, image, add button) (0) | 2011.12.15 |
---|---|
동영상 플레이시 "Done"버튼을 "완료"버튼으로 표시 (0) | 2011.12.15 |
UIScrollView와 UIPageControl을 이용하여 페이징 처리하기 (0) | 2011.12.15 |
D-Day 구하기 and 요일 구하기 and 날짜 <- -> 스트링 변환 (0) | 2011.12.15 |
어플에서 아이튠 검색으로 넘어가는 방법 (0) | 2011.12.15 |