UITableView仅显示第一行 [英] UITableView show only first row

查看:53
本文介绍了UITableView仅显示第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序具有3个选项卡(孩子,积分和请求),并带有相同的结果列表.我正在使用自定义单元格在3个标签中显示具有相同数据的孩子信息.

My app has 3 tabs (Kids, Points and Requests) with same result list. I'm using a custom cell to show kids information with same data in 3 tabs.

例如:

孩子"标签:

  • 孩子的名字1
  • 孩子的名字2
  • 孩子的名字3

积分"标签:

  • 孩子的名字1
  • 孩子的名字2
  • 孩子的名字3

请求"标签:

  • 孩子的名字1
  • 孩子的名字2
  • 孩子的名字3

当我转到请求"并选择一个孩子时,我按另一个视图查看每个选定孩子的总请求数.现在,这很奇怪,当我返回到点数"或孩子"选项卡并重新加载时(我正在使用拉动刷新,这不是问题),仅出现第一行!

When I go to Requests and select a kid I push another view with total requests per selected kid. Now the VERY weird thing, when I back to Points or Kids tab and reload (i'm using pull to refresh, what is not the problem) only the FIRST row appear!

我正在使用NSXML解析XML,然后在填充表格视图后添加到名为itemList的NSMutableArray中.

I'm using NSXML to parse the XML and adding to a NSMutableArray called itemList after this I populate the tableview.

我已经尝试过的方法:

  1. 试图用TBXML替换NSXML解析器没有成功出现相同的问题.

  1. tried to replace NSXML with TBXML parser without success the sameproblem occurs.

试图删除自定义单元格并使用没有成功的默认单元格.

tried to remove custom cells and use the default cell without success.

试图更改单元格标识符没有成功.

tried to change the cell identifiers without success.

试图更改所有变量名称试图避免变量替换.

tried to change all variables names trying to avoid variable replacement.

NS登录应用程序中的所有var和objs试图显示一切而没有成功.

NSLog in all vars and objs in app trying to show everything without success.

试图删除拉动以刷新和发生同样的问题.

tried to remove pull to refresh and same problem occurs.

感谢所有的帮助:)

谢谢!克莱伯·桑托斯

推荐答案

您需要知道的第一件事是这是否是数据问题,或者这是 tableviewdelegate >问题.我将从交换一个静态NSArray代替您的数据源开始,然后在模拟器中重新运行您的应用程序.如果它按预期工作,则表明静态数据正常工作",而问题出在您的数据源上.

The first thing you need to know is if this is a data problem or if this is a tableviewdelegate problem. I would start by swapping a static NSArray in place of your data source then re-running your app in the simulator. If it works as expected, then that means that the static data "worked" and the problem is your data source.

如果静态 NSArray 数据不起作用,则意味着您的问题出在tableView的委托或(更可能是)dataSource方法上.如果是这种情况,请尝试查找它,并在以后的帖子中提供代码示例,以获取帮助.

If the static NSArray data doesn't work, then that means your problem is with your tableView's delegate or (more likely) dataSource methods. If it turns out this is the case, then try to hunt it down and supply a code sample in a future post if you need help.

注意:在将数据源换成 NSArray 之前,是将您的源分支到Git/Subversion/任何地方的好时机,这样,如果它与您可以撤消更改的静态数据.而且不要告诉我您不是在使用SCM !!!!!

NOTE: Before you swap out your data source for the NSArray would be a good time to branch your source in Git/Subversion/whatever so that if it doesn't work with the static data you can pull back your changes. And DON'T TELL ME YOU'RE NOT USING SCM!!!!!

这篇关于UITableView仅显示第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆