Recently, you need to display directory data in tableview. There is a difference between level 1 and level 2 directories. The structure of the database is as follows:
Id is the primary key, name is the name, and parent is the id of the level-1 directory. If it is-1, it indicates that it is a level-1 directory. Then I want to read data from the database and put it in tableview. The first-level directory serves as the section title and the second-level directory serves as its content. The result shows a problem: Only one directory is displayed for the second level, and it is displayed repeatedly. After some time is spent, record it to prevent forgetting it. This problem occurs because you are not familiar with tableview.
The main code is as follows: array is a level-1 directory, and CatalogueData is all the data read from the database. <Strong? Http: www.bkjia.com kf ware vc "target =" _ blank "class =" keylink "> VcD4KPHA + pgltzybzcm9 "http://www.bkjia.com/uploadfile/Collfiles/20140102/2014010209552916.jpg" alt = "\">