IOS tableView Data Display

Source: Internet
Author: User

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 = "\">




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.