Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在xcode中使用数组传递本地html文件_Ios_Uitableview_Uiwebview - Fatal编程技术网

Ios 如何在xcode中使用数组传递本地html文件

Ios 如何在xcode中使用数组传递本地html文件,ios,uitableview,uiwebview,Ios,Uitableview,Uiwebview,这里我正在申请, 当我单击表视图时,它将重定向到另一个名为details的页面。在这里,我使用了一个webview来显示所选的url值。 这是我的密码 -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:YES]; self.navigationItem.title=@"sample"; servicesArray=[[NSMutableArray alloc]init]; [servicesA

这里我正在申请, 当我单击表视图时,它将重定向到另一个名为details的页面。在这里,我使用了一个webview来显示所选的url值。 这是我的密码

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:YES];

    self.navigationItem.title=@"sample";
    servicesArray=[[NSMutableArray alloc]init];
    [servicesArray addObject:@"1"];
    [servicesArray addObject:@"2"];
    [servicesArray addObject:@"3"];

    urlsArray=[[NSMutableArray alloc]init];
    [urlsArray addObject:@"http://www.google.com"];
    [urlsArray addObject:@"http://www.yahoo.com"];
    [urlsArray addObject:@"http://www.facebook.com"];


}
这里不是URL链接,我想传递我的本地html文件。你能帮帮我吗

谢谢
钦图

像这样尝试,获取数组中的所有html文件名

NSString *htmlFile = [[NSBundle mainBundle] pathForResource:[yourArray objectAtIndex:selectedIndex] ofType:@"html" inDirectory:nil];
NSString* htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil];
[WebView loadHTMLString:htmlString baseURL:nil];

4应为错误“:”在声明末尾缺少“[”在消息发送表达式的开头使用未声明的标识符“htmlArray”