• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

iphone - 如何使用 NSXMLParser 读取此 CDATA

[复制链接]
菜鸟教程小白 发表于 2022-12-12 20:21:11 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我熟悉 NSXMLParser,我用它来读取一些 XML 行,但我对这些行有疑问:

    <item>
    <title>rice 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>rice:</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 : [email protected]<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>

如何从描述元素中获取 img src?

谢谢



Best Answer-推荐答案


使用这个方法...

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

希望这会有所帮助...

关于iphone - 如何使用 NSXMLParser 读取此 CDATA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10214747/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap