为什么我写删除UITableView行的代理时新日股份出了问题题

http://dcm./blog/static//
http://blog.csdn.net/lvxiangan/article/details/
本文已收录于以下专栏:
相关文章推荐
作者:朱克锋
转载请注明出处:http://blog.csdn.net/linux_zkf
实现效果图如下两个图示所示
http://dcm./blog/static//
http://blog.csdn.net/lvxianga...
Linux老难题解决了!
Linux工程师很多,甚至有很多有多年工作经验,但是对一些关键概念的理解非常模糊,比如不理解CPU、内存资源等的真正分布,具体的工作机制,这使得他们对很多问题的分析都摸不到方向。比如进程的调度延时是多少?linux能否硬实时?多核下多线程如何执行?
在UITableView中插入或者删除指定的行(或者节)使用的是如下几个API:
insertRowsAtIndexPath: withRowAnimation: 在指定位置插入行
在UITableView中插入或者删除指定的行(或者节)使用的是如下几个API:
insertRowsAtIndexPath: withRowAnimation: 在指定位置插入行
deleteR...
系统已经提供了方法来处理UITableView的插入和删除行。
- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimati...
他的最新文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)1004人阅读
1、是否设置代理与数据源
[table setDelegate:self];
[table setDataSource:self];
2、numberOfSectionsInTableView是否设置
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
3、numberOfRowsInSection方法返回值是否正确,如果不正确就不会执行 cellForRowAtIndexPath。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
4、检查Table是否被其他View遮挡
5、还有可能是autolayout引起的,autolayout约束不对,也会导致tableview显示不出来,
cellForRowAtIndexPath是在显示到界面的时候才调用,正确的设置autolayout就会执行该方法。
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:16794次
积分:1123
积分:1123
排名:千里之外
原创:96篇
转载:18篇
(16)(8)(1)(1)(4)(2)(2)(13)(3)(1)(3)(3)(2)(7)(7)(12)(15)(15)【IOS移动端】(266)
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{& & & & returnUITableViewCellEditingStyleD
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{& & & & if (editingStyle == UITableViewCellEditingStyleDelete)& & & & {& & & & [self.items removeObjectAtIndex:indexPath.row];& & & & [tableView reloadData];& & & & }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{& & & & NSLog(@&Row %@ tapped.&, self.items[indexPath.row]);
在ios6环境下,上段代码运行正常。但是在ios7环境下,我做了如下操作:当tableview中的一行被删除并更新tablview后,被删除行的下一行的点击事件将被忽略,导致点击该行无反应(双击才有反应)。很奇怪是不是,下面将解释原因。
当tableview中的某行被选中删除后,tableview将处于编辑(editing)状态,所以你需要将tableview中的状态更换成选择(selection)模式,更改代码如下:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{ if (editingStyle == UITableViewCellEditingStyleDelete) {& & & & [self.items removeObjectAtIndex:indexPath.row];& & & & // Turn off editing state here& & & & tableView.editing = NO;& & & & [tableView reloadData]; }
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:625276次
积分:9327
积分:9327
排名:第1997名
原创:272篇
转载:235篇
译文:14篇
评论:31条
阅读:3820
阅读:2486
阅读:25718

我要回帖

更多关于 滁州张祥安出了问题 的文章

 

随机推荐