-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOfflineBrowserViewController.m
54 lines (41 loc) · 1.28 KB
/
OfflineBrowserViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// OfflineBrowserViewController.m
// NYU WSN
//
// Created by Ricky Cheng on 8/6/09.
// Copyright 2009 Family. All rights reserved.
//
#import "OfflineBrowserViewController.h"
@implementation OfflineBrowserViewController
@synthesize browser, filePath;
- (void)loadView {
UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,372)];
contentView.backgroundColor = [UIColor whiteColor];
self.view = contentView;
[contentView release];
browser = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,320,372)];
browser.scalesPageToFit = YES;
browser.userInteractionEnabled = YES;
browser.multipleTouchEnabled = YES;
browser.dataDetectorTypes = UIDataDetectorTypeAll;
[self.view addSubview:browser];
}
- (void) viewDidLoad {
NSError *error = nil;
NSString *html = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error];
DLog(@"html ? => %@",html);
[browser loadHTMLString:html baseURL:nil];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end