Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.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
Iphone 如何使用NSXMLParser读取此CDATA_Iphone_Objective C_Ios_Nsxmlparser_Cdata - Fatal编程技术网

Iphone 如何使用NSXMLParser读取此CDATA

Iphone 如何使用NSXMLParser读取此CDATA,iphone,objective-c,ios,nsxmlparser,cdata,Iphone,Objective C,Ios,Nsxmlparser,Cdata,我熟悉NSXMLParser,并使用它阅读一些XML行,但我对这些行有一个问题: <item> <title>Price Drop: AngerOfStick2 (Games)</title> <link>http://appshopper.com/games/angerofstick2</link> <category>Games</category> <guid

我熟悉NSXMLParser,并使用它阅读一些XML行,但我对这些行有一个问题:

    <item>
    <title>Price Drop: AngerOfStick2  (Games)</title>
    <link>http://appshopper.com/games/angerofstick2</link>
    <category>Games</category>
    <guid isPermaLink="false">http://appshopper.com/games/angerofstick2-Wed, 18 Apr 2012 10:49:58 EDT-price</guid>
    <description><![CDATA[
        <img src="http://images.appshopper.com/icons/408/347359.png" align="left"/>
        <h3>AngerOfStick2 1.1.6</h3><br/>
        <b>Device:</b> iOS iPhone<br />
        <b>Category:</b> Games<br />
        <b>Price:</b> $.99 -> Free, <b>Version:</b> 1.1.6 (<a href="/link/angerofstick2">iTunes</a>) <br/><br/>
        <img src="http://a1.mzstatic.com/us/r1000/106/Purple/v4/f7/91/f9/f791f91e-454f-9525-2ebc-9c341707d0ad/mza_5266557554023051353.640x960-75.jpg" width="480" align="right"/>
        <b>Description:</b><br /><br />
        Limited Time SALE! 50% OFF! Get it now and don’t miss out!============UPDATES INFO============= version 1.0.1 :-Game Center Support-RETINA Icon Supportversion 1.0.2 :- Doodle Runner ( Add New Mode )version 1.0.3 :- Survival Mode ( Add New Mode ) version 1.0.4 :- Jump Jump Mode ( Add New Mode ) version 1.0.6 :-Mulitiplayer Mode: 1 vs 1   ( Add New Mode )------Main Update Plan------=====================================User say :- &quot; This is a wonderful game! It has a perfect balance of fast action-packed entertainment, and it is completely addicting! I would recommend this game to anyone! &quot;- &quot; Get this game! It's one of the best games I've played for a while! GET THIS GAME! &quot;- &quot; This game is the beast so addicte to it I can't stop playing it. &quot;- &quot; This is a great game! Really REALLY entertaining when you get into the zone. 5 stars !!!!!!!!!!!!!!!!  &quot;- &quot; Ohh yeaaaaaaaa oh yeaaaa oh yea! &quot;Introduction:- Anger of stick 2nd Story -Unknown enemies in the city emerge and the hero continues to remove enemies with a variety of weapons, and helicopters and robots that can devastate all enemies at a time.Special Features: - Action : You can feel the realistic fighting action with 130 behaviors and Hero air combo action is added that can remove all enemies at one time.- Weapons: Enemies can be handled lightly by using helicopters and robots in the map, and weapons such as M1911, UZI, Granade Luncher, Spas_12, SG550, Remington_870, Flamethrower, Ray-gun, Mini-gun, Bat, and Sword.- Map: Cities, deserts and forests are configured in the map and the fighting action inside building is added.Tips:- When enemies come on the both sides, all enemies will be fallen down on seizing and throwing enemies back.- An infinite combo attack is available with Hero air combo.- Enemies can be handled by well-using robots and helicopters on the streets.- To avoid the attacks from guns and robots of enemies, button on the key to move to the left is necessary.Support Information: For additional support, please contact: E-mail : pjh097@gmail.com<br/><br/><b>What's New</b><br /><br />Fixed some bug.<br/><br/>
        <a href="http://appshopper.com/games/angerofstick2">AngerOfStick2</a><br /><br />
    ]]></description>
    <pubDate>Wed, 18 Apr 2012 10:49:58 EDT</pubDate>
    </item>

降价:AngerOfStick2(游戏)
http://appshopper.com/games/angerofstick2
游戏
http://appshopper.com/games/angerofstick2-Wed,2012年4月18日10:49:58美国东部时间价格
AngerOfStick2 1.1.6
设备:iOS iPhone
类别:游戏
价格:$.99->免费,版本:1.1.6()

说明:

限时销售!五折现在就去拿,别错过了============更新信息=======版本1.0.1:-游戏中心支持视网膜图标支持版本1.0.2:-涂鸦跑步者(添加新模式)版本1.0.3:-生存模式(添加新模式)版本1.0.4:-跳跃模式(添加新模式)版本1.0.6:-多人模式:1对1(添加新模式)------主要更新计划----------------=============================================用户说:-“这是一款精彩的游戏!它完美地平衡了快速动作的娱乐功能,完全让人上瘾!我会向任何人推荐这款游戏!”-“获得这款游戏!这是我玩过的最好的游戏之一!获得这款游戏!”“这个游戏是野兽,我对它如此着迷,以至于我无法停止玩它。“-”这是一场伟大的比赛!当你进入这个区域时,真的很有趣。五星!!!!!!!!!!!!!!!!“-“哦,是的,是的,是的!“简介:-棍棒之怒第二个故事-城市中出现了未知的敌人,英雄继续使用各种武器、直升机和机器人清除敌人,这些武器可以一次摧毁所有敌人。特别功能:-动作:你可以通过130种行为感受到真实的战斗动作,并添加了英雄空中连击动作,可以一次性消灭所有敌人。-武器:地图上的直升机和机器人可以轻松对付敌人,M1911、UZI、格拉纳德·午餐者、Spas_12、SG550、Remington_870、火焰喷射器、射线枪、迷你枪、蝙蝠和剑等武器。-地图:地图中配置了城市、沙漠和森林,建筑物内的战斗行动是一个简单的过程dded.提示:-当敌人从两边来时,所有的敌人都会在抓住敌人并将其扔回时倒下。-英雄空中连击可以进行无限组合攻击。-在街道上使用机器人和直升机可以很好地对付敌人。-要避免敌人的枪支和机器人的攻击,请按键向左移动是必需的。支持信息:有关其他支持,请联系:电子邮件:pjh097@gmail.com

新功能

修复了一些错误。



]]> 2012年4月18日星期三美国东部时间10:49:58
如何从description元素获取imgsrc

谢谢

使用此方法

- (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock
{
    NSString *someString = [[NSString alloc] initWithData:CDATABlock encoding:NSUTF8StringEncoding];
// reparse the string to extract the img src attribute value... 
}
希望这有助于…:D

使用此方法

- (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock
{
    NSString *someString = [[NSString alloc] initWithData:CDATABlock encoding:NSUTF8StringEncoding];
// reparse the string to extract the img src attribute value... 
}

希望这能有所帮助……:D

但请注意:您不能立即使用
NSXMLParser
解析从CDATA获取的字符串。从中可以看出:“NSXMLParser现在是线程安全的。但是,它在给定线程上不可重入;不要从另一个NSXMLParser的委托回调中调用-parseme@AnkitSrivastava你能告诉我你到底可以如何重新解析它吗?@Jessica你可以在这个回调中创建一个新的NSXMLParser实例并解析“someString”“根据需要。但请注意:您不能立即使用
NSXMLParser
解析从CDATA获取的字符串。来自:“NSXMLParser现在是线程安全的。但是,它在给定线程上不可重入;不要从另一个NSXMLParser的委托回调中调用NSXMLParser上的-parse。”它工作得很好,但我得到了部分数据。你能告诉我出了什么问题吗me@AnkitSrivastava你能告诉我你到底可以如何重新解析它吗?@Jessica你可以在这个回调中创建一个新的NSXMLParser实例,并根据需要解析“someString”。