我需要以下代码的帮助,我使用hpple来解析html。 我需要帮助利用这些数据。从数组填充一个UITableView
-(void) whatever{
NSData *htmlData = [[NSString stringWithContentsOfURL:[NSURL URLWithString: @"http://www.objectgraph.com/contact.html"]] dataUsingEncoding:NSUTF8StringEncoding];
TFHpple *xpathParser = [[TFHpple alloc] initWithHTMLData:htmlData];
NSArray *titles = [xpathParser search:@"//h3"]; // get the page title - this is xpath notation
TFHppleElement *title = [titles objectAtIndex:0];
NSString *myTitles = [title content];
NSArray *articles = [xpathParser search:@"//h4"]; // get the page article - this is xpath notation
TFHppleElement *article = [articles objectAtIndex:0];
NSString *myArtical = [article content];
我想创建,并从数组填充表“标题” 然后可以点击桌子上的物品装入一个子视图应该显示相同指数在相应ARTICAL?
我想这样做编程或使用IB
任何人都可以提出一些示例代码或教程?
谢谢。
这是伟大的rajesh,这会为我创建表还是我需要在界面生成器中创建tableview?我需要调用这些吗?对不起,我的无知是新的IOS dev – 2010-12-06 16:48:16