0 Replies - 18596 Views - Last Post: 27 December 2012 - 06:35 PM

#1 sdla4ever  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 55
  • Joined: 26-September 11

UIWebView Displaying a local html file

Posted 27 December 2012 - 06:35 PM

Ok I'm slowly teaching myself Objective-C and iOS SDK. But I am working on a project now and all I want to do is use UIWebView to display a local website. I have it working for a hosted website but not local.

Here is what I currently have:

- (void)viewDidLoad {
    [super viewDidLoad];
    NSString *fullURL = @"http://fc-pc.com/AMG/index.html";
    NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"www"]];
    [_viewWeb loadRequest:[NSURLRequest requestWithURL:url]];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [_viewWeb loadRequest:requestObj];
}



I am very new to this so I thank anyone for their patience and help.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1