Iphone 如何在单个tableviewcontroller中包含主题和子主题?

Iphone 如何在单个tableviewcontroller中包含主题和子主题?,iphone,ios,uitableview,ios5,Iphone,Ios,Uitableview,Ios5,我只是想使用tableview创建如下内容,但我不确定如何使其工作 Sports (If it get touched it expands the subtopics) Cricket (When it get Touched it push to next view controller) Football VolleyBall Bike (If it get touched it expands the subtopics) HeroHonda (Wh

我只是想使用tableview创建如下内容,但我不确定如何使其工作

 Sports (If it get touched it expands the subtopics) 
    Cricket (When it get Touched it push to next view controller)
    Football
    VolleyBall
 Bike (If it get touched it expands the subtopics)
    HeroHonda (When it get Touched it push to next view controller)
    Kawasaki
    Yamaha
主题和子主题的数量是已知的

有可能像我期望的那样去做吗? 如果无法使用表视图,那么其他方法是什么


非常感谢您的帮助

请遵循您需要重新加载部分以展开和折叠子主题。

如果您确实需要展开效果,我建议您使用一些开源解决方案,例如,甚至

更简单的解决方案是只对类别使用UITableViewSections,对项目使用单元格,例如

Section 0 : Sports
  - Row 0 : Cricket
  - Row 1 : Football

Section 1 : Bike
  - Row 0 : Yamaha
  - Row 1 : Kawasaki 

您能否进一步详细说明您正试图实现的目标?为主题和子主题创建两个
UITableViewCell
子类,并相应地使用它们(只有一个部分)。然后在点击主题时插入/删除行(当然,在重新加载表格之前更新数据源)。谢谢你的回答,我将尝试+1