Code for the first Tab Bar Web View project.
In the .h files for each of the View controller files you should write the text in bold where indicated.
@interface FirstViewController : UIViewController {
IBOutlet UIWebView *firstwebView;
}
The best bet it to name the FirstViewController web view firstwebView and son on for the other Web views.
In ViewController.m files in your classes folder and replace
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/
With this code, assuming that the first page you want to display is called index.
This code tells your app to open a file called index.html in firstwebView i.e. your first tab.
- (void)viewDidLoad {
NSString *path = [[NSBundle mainBundle] pathForResource:@”index”
ofType:@”html”];
[firstwebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath: path
isDirectory:NO] ]];
[super viewDidLoad];
}
If you want to bundle a PDF file use this code in the .m file:
- (void)viewDidLoad {
NSString *path = [[NSBundle mainBundle] pathForResource:@”filename”
ofType:@”pdf”];
[thirdwebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath: path
isDirectory:NO] ]];
[super viewDidLoad];
}
If you want a view to go to a site use this code in the .m file:
- (void)viewDidLoad {
[fourthwebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.makeanapp.info/"]]];
}



