Objective c 使用Swift中的TFHpple框架编译错误
我有这个HTMLObjective c 使用Swift中的TFHpple框架编译错误,objective-c,compiler-errors,swift,Objective C,Compiler Errors,Swift,我有这个HTML <div class="header1" style="text-align: center;"> <div class="s"> <center> <table> <tr> <td> <ul style="position: re
<div class="header1" style="text-align: center;">
<div class="s">
<center>
<table>
<tr>
<td>
<ul style="position: relative;">
<li>
<a>
<p>
Apple Kid
</p>
它显示了这些函数中关于未知类型的错误
XpathQuery.m
//
// XPathQuery.m
// FuelFinder
//
// Created by Matt Gallagher on 4/08/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "XPathQuery.h"
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/HTMLparser.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>
NSDictionary *DictionaryForNode(xmlNodePtr currentNode, NSMutableDictionary *parentResult,BOOL parentContent);
NSArray *PerformXPathQuery(xmlDocPtr doc, NSString *query);
//
//XPathQuery.m
//燃料探测器
//
//马特·加拉赫于2008年8月4日创作。
//版权所有2008年uu MyCompanyName uuu。版权所有。
//
#导入“XPathQuery.h”
#进口
#进口
#进口
#进口
#进口
NSDictionary*DictionaryForNode(xmlNodePtr currentNode,NSMutableDictionary*parentResult,BOOL parentContent);
NSArray*PerformXPathQuery(xmlDocPtr doc,NSString*查询);
您应该分享收到的准确错误,但我使用Swift的TFHpple没有问题。正如你对Objective-C所做的那样,你必须
- 确保在构建阶段链接到
库libxml
- 在生成设置中将
添加到标题搜索路径中$(SDKROOT)/usr/include/libxml2
#导入“TFHpple”
。有关更多信息,请参阅《将Swift与可可和Objective-C一起使用指南》一章的“将Objective-C导入Swift”一节
一旦您这样做了,您应该能够使用TFHpple而不会发生Swift事件
//
// XPathQuery.m
// FuelFinder
//
// Created by Matt Gallagher on 4/08/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "XPathQuery.h"
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/HTMLparser.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>
NSDictionary *DictionaryForNode(xmlNodePtr currentNode, NSMutableDictionary *parentResult,BOOL parentContent);
NSArray *PerformXPathQuery(xmlDocPtr doc, NSString *query);