我有一个UITableViewController管理iPad应用程序中的UITableView对象。表格视图与其他对象的相当复杂的星座相关联。我有一个问题,当我要求它重新加载一行如下:UITableView的reloadRowsAtIndexPaths:(NSArray *)indexPaths无法重新加载,除非您调用它两次?
//indexPath is an NSIndexPath with indexes 0 and 0. At the moment, this is the only cell in the table view.
NSArray *array = [NSArray arrayWithObject:indexPath];
[self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationNone];
问题是行不重新加载。从来没有回调cellForRowAtIndexPath。
疯狂的事情是,如果我叫reloadRowsAtIndexPaths两次,第二次通话不会触发重装:
//indexPath is an NSIndexPath with indexes 0 and 0. At the moment, this is the only cell in the table view.
NSArray *array = [NSArray arrayWithObject:indexPath];
[self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationNone]; // does not reload
[self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationNone]; // does reload
我想知道是否有人曾经遇到过这样的错误,如果是这样,究竟是什么原因?
你在做一些后台线程? – Daniel 2011-04-05 19:44:59
有一个测试用例吗? – 2011-04-06 22:01:15
主线程。如果通过“测试案例”,你的意思是一个简单的例子,说明同样的事情,没有我没有,我希望我做到了。 – 2011-04-09 02:08:48