[問題] 記錄點選cell的行數
抱歉
短短的幾天碰到很多問題
我想要將我點選到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
→
06/07 11:42, , 1F
06/07 11:42, 1F
→
06/07 11:42, , 2F
06/07 11:42, 2F
討論串 (同標題文章)
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章