如何在專案中設定使用GDataXML解析類庫

2021-06-07 15:06:52 字數 909 閱讀 8793

2. 解壓縮檔案,找到source\xmlsupport,並且將其中的gdataxmlnode.h 和 gdataxmlnode.m檔案拖到專案中

3. 選中專案,選中「build settings」標籤頁

4. 將build settings頁中,頂部的「basic」標籤切換到「all」

5. 找到「paths\header search paths」項,並新增「/usr/include/libxml2」到列表中

6. 找到「linking\other linker flags」項,並新增「-lxml2」到列表中

在需要呼叫gdataxml的**檔案頭部,加入:

#import "gdataxmlnode.h"

應用示例:建立dom結構

nsdata *xmldata = [[nsmutabledata alloc] initwithcontentsoffile:@"

test.xml

"];nserror *error;

gdataxmldocument *doc = [[gdataxmldocument alloc] initwithdata:xmldata options:0 error:&error];

基於xpath解析

nsarray *themeattr = [doc nodesforxpath:@"

//theme

" error:&error];

for(gdataxmlelement *themeelement in themeattr)

分類: 

iphone&ipad

如何在Flutter專案中使用GraphQL

麼是graphql 這篇文章主要是看一下如何在flutter專案中使用graphql,如果不清楚graphql是什麼,建議先看下官網對其介紹 從圖中也能看出,分3部分 可以看出,在這個graphql server中,我們可以查詢 continents continent countries coun...

如何在CPP專案中使用CUDA

很多時候我們需要對乙個cpp專案中某一部分進行gpu加速,如下步驟能夠實現這一目的。直接新建或者開啟已有的cpp專案 右鍵專案,新建或者新增已有的.cu cu 件 注意 cpp檔案不能直接呼叫kernel函式 新增了cuda的標頭檔案也不行 於是我們可以以函式呼叫的方式,從.cpp檔案呼叫乙個.cu...

如何在專案中做出亮點

之前在群裡參加活動的同學,有不少說在小公司,被業務需求壓著。既然大家都說在做業務,那麼,正看到這裡的你,能不能5分鐘說明白,你負責的業務是什麼?這個問題我在活動群的github issue活動中,帶有業務理解標籤的題目裡經常會問到,可是大部分同學都沒有說到位,甚至答非所問。這裡談談我個人對業務的理解...