in my app I have a table view where I download a list of hotels parsed by an XML(for every hotel i put in xml an attribute STARS); I need to view hotels by stars (from 5 stars to three stars), dividing it into three sections. So I have a section "5 stars" where there are 5-star hotel, a section "4 stars" where there are the 4-star hotel and thus also for the 3-star hotels. How can do this??
A:
I'd go with three separate arrays to hold your data, and then use your delegate to answer 3 for the number of sections, and populate the cells accordingly.
Eiko
2010-07-21 09:11:21
I'd use a fourth array to hold the section names, and then use the count of that to answer the number of sections :)
willcodejavaforfood
2010-07-21 09:13:26
There is a problem; in my app there aren't only hotels but also restaurants and other events, all parsed and placed in a single array and displayed from a single controller in a single table view based on selected category.how do I insert only "hotels" elements in three array??
Claudio
2010-07-21 09:48:11