作者freejer (.....)
看板MacDev
标题[问题] 记录点选cell的行数
时间Mon Jun 6 19:48:53 2011
抱歉
短短的几天碰到很多问题
我想要将我点选到cell的index存入array中
但目前回传的都是null
想请大家帮忙
谢谢
- (void)tableView:(UITableView *)table didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [table cellForRowAtIndexPath:indexPath];
NSString *temp;
group=[NSMutableArray array];
NSUInteger select_row=[indexPath row];
if (cell.accessoryType != UITableViewCellAccessoryCheckmark)
{
cell.accessoryType = UITableViewCellAccessoryCheckmark;
----->点选到的cell会出现打勾的mark
[group addObject:indexPath.row];---------------->想要将行数加入
temp=[group objectAtIndex:select_row];--------->丢到字串中读出
}
NSLog(@"row: %@ is marked ~~ delete it!",temp);
[group release];
}
大概是这样的概念
会用array是因为我需要点选很多次
一次把它记录起来在读出
再次谢谢大家的指导
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 111.240.175.138
1F:→ hechian:[NSNumber numberWithInt:select_row]; 06/07 11:42
2F:→ hechian:把这个丢到NSMutableArray内 06/07 11:42