NSXMLParser:请求指导从RSS/XML订阅源制作分组表格
问题描述:
我正在制作一个从XML/RSS订阅源填充的组表格,我设法将数据解析到表格中,但还是陷入了如何使表分组?NSXMLParser:请求指导从RSS/XML订阅源制作分组表格
即,我想要一个事件列表,并且我想组织事件,使用每个组的月份,我将如何实现这一目标?下面
是我的XML结构,其基本相当
<EventsUpcoming>
<Event id="1">
<month>July</month>
<title>Ian Moss</title>
<date>Saturday, July 1st</date>
<ticket>$35 On the door</ticket>
<description>
Ian Moss from Cold Chisel fame will be touring Australia and the only venue to secure him in Perth is the Blvd.
</description>
</Event>
<Event id="2">
<month>August</month>
<title>Cold Chisel</title>
<date>Saturday, August 3rd</date>
<ticket>$25 on the door</ticket>
<description>
From Khe San fame, Cold Chisel is back with the legendary Jimmy Barnes, dont miss out this gig. Its gonna go down in the books for sure!
</description>
</Event>
<Event id="3">
<month>September</month>
<title>Australian Crawl</title>
<date>Saturday, September 1st</date>
<ticket>Free</ticket>
<description>
They're one of Australia's most iconic band names, be sure to come down and check them out before they die.
</description>
</Event>
</EventsUpcoming>
如果有人知道这可能是如何去这样做有用的或只是提示任何教程网站,thatd大加赞赏。在此先感谢:)
答
NSMutableSet不存储重复值,它只存储不同的。因此,在解析时,您可以使用NSMutableSet存储每个XML元素的'月'值并设置数字在tableview中的部分到你的NSMutableSet的数量。
那么你是说,我可以有一个“月”下的多个事件,然后只是数它们? – Andyy 2011-06-09 06:06:36