IOS growth path-minor issues with UITableViewController

Source: Internet
Author: User

When using the list interface, we all know that

-(NSInteger) tableView :( UITableView *) tableView numberOfRowsInSection :( NSInteger) section
(Method 1)

This method returns several rows of data on this interface, while

-(UITableViewCell *) tableView :( UITableView *) tableView cellForRowAtIndexPath :( NSIndexPath *) indexPath
(Method 2)

This method inputs data for each row,


When we use method 1 to return 0, that is, no rows, method 2 will not be executed.

Their relationships are closely linked. Only when the return value of method 1 is greater than 0 will method 2 be executed to add data.


When we add the parsed xml data to the list for display, the problem arises, because we know that when the project is running, the above method 1, method 2 and so on are the first to run the method for parsing xml data,

Obviously, no value can be output on the interface, so we need to refresh the interface after parsing the xml data:

[Self. tableViewreloadData];

In this way, the parsed data can be obtained and displayed.

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.