我有以下代码,我想使用NSMutable数组,而不是NSArray
你可以告诉我如何加载NSMutable数组,因为当前的方法不起作用.
你可以告诉我如何加载NSMutable数组,因为当前的方法不起作用.
-(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];
我努力了 :
NSMutableArray *titles = [xpathParser search:@"//h3"];
但它确实加载值?