Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.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
Iphone Uiwebview中解析的url_Iphone_Uiwebview_Html Parsing - Fatal编程技术网

Iphone Uiwebview中解析的url

Iphone Uiwebview中解析的url,iphone,uiwebview,html-parsing,Iphone,Uiwebview,Html Parsing,我正在使用tfhpple解析html页面,然后接收标题和URL。然后,我使用这些数据在tableview中显示标题,当我单击一行时,detailview将打开uiwebview,其中包含所选行的URL。 我的问题是如何将收到的URL转换为detailsview Web视图? 我在想,我必须将数据存储在Nsdata中,并以某种方式使用它来显示URL。 到目前为止,我得到的是: 已编辑 这是我从网站www.fr12.nl获取数据的地方 -(void)loadFr12Feed { // 1 N

我正在使用tfhpple解析html页面,然后接收标题和URL。然后,我使用这些数据在tableview中显示标题,当我单击一行时,detailview将打开uiwebview,其中包含所选行的URL。 我的问题是如何将收到的URL转换为detailsview Web视图? 我在想,我必须将数据存储在Nsdata中,并以某种方式使用它来显示URL。 到目前为止,我得到的是:

已编辑

这是我从网站www.fr12.nl获取数据的地方

 -(void)loadFr12Feed {
  // 1

NSURL *Fr12WebsiteLink = [NSURL URLWithString:@"http://www.fr12.nl/"];
NSData *Fr12WebsiteHtmlData = [NSData dataWithContentsOfURL:Fr12WebsiteLink];

//
TFHpple *Fr12WebsiteParser = [TFHpple hppleWithHTMLData:Fr12WebsiteHtmlData];

// 3
//NSString *Fr12WebsiteXpathQueryString = @"//div[@class='content_left_extra']/ul/li/a";
NSString *Fr12WebsiteXpathQueryString = @"//div[@class ='content_left_extra']/ul/li/a";
NSArray *Fr12WebsiteNodes = [Fr12WebsiteParser   searchWithXPathQuery:Fr12WebsiteXpathQueryString];

// 4
  NSMutableArray *newFr12Website = [[NSMutableArray alloc] initWithCapacity:0];
 for (TFHppleElement *element in Fr12WebsiteNodes) {
    // 5
    Fr12Opslag *fr12opslag = [[Fr12Opslag alloc] init];
    [newFr12Website addObject:fr12opslag];

    // 6
    fr12opslag.title = [element objectForKey:@"title"];


    // 7
   // bowtiefulimages.url = [element objectForKey:@"src"];



}

// 8
Fr12Content = newFr12Website;
[self.tableView reloadData];
}
这是我正在解析的html:


我在tableview中获得标题,但我希望detailview显示来自“href”的文章,但我不知道如何做到这一点。

为了更好地了解您的目标,我们可以查看任何代码吗?我编辑了我的问题@avitex