Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.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
Objective c 使用Swift中的TFHpple框架编译错误_Objective C_Compiler Errors_Swift - Fatal编程技术网

Objective c 使用Swift中的TFHpple框架编译错误

Objective 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

我有这个HTML

 <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
    添加到标题搜索路径中

请参阅Wenderlich's或Cocoa with Love's上的安装说明

将TFHpple源添加到项目时,应提示您创建桥接标头。这样做,然后添加
#导入“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);