IOS: Using UITableView to create a table application walkthrough (2) Loading and displaying data from a plist file

Source: Internet
Author: User
Tags definition

A very simple walkthrough of table loading and display is described above. Some friends may say, this also said is simple, can be a bit complicated?

Don't worry, as a programmer, keep in mind that no matter how complex applications evolve from simple applications.

Objective of this article

This article is based on the above, the application is extended to introduce the following content:

1. Data structure definition;

2. Loading and displaying data from plist files;

3. Display the Avatar in the table and adjust the table style;

4. Use the data model.

I. Data structure definition

In the previous walkthrough, an array was defined with Nsarray to provide tabular content, but in practice this functionality is far from satisfying the actual usage requirements.

In the previous article, we mentioned that we would like to do a maintenance of "Weibo concern people" application. So for the attention of people, a name clearly does not meet the needs of our application.

Before we begin, we might as well take a moment to determine what information we are interested in, in addition to our name, to determine the data structure. See figure below:

We add five attributes to our focus: Name, avatar, url, preference, and category.

Here we add a plist file to record the data we need to use later.

1. Click the right mouse button in "My Focus", select "New Group" in the pop-up menu, and enter "Data" as the name of the new group, as shown in the following figure:

2. Click the right mouse button on "Data", select "New File ...", then select "Resource" "Property List" and click "Next" to see the following image:

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.