【发布时间】:2013-12-22 22:59:06
【问题描述】:
我有一个表格视图
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
**NSString *channelID = [object objectForKey:@"channelID"];**
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell==nil)
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier];
}
我正在像这样访问一个表格视图单元格:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
for (NSIndexPath *path in [tableView indexPathsForVisibleRows]) {
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path];
}
//I want to access cell.ChannelID //
}
如何访问 channelID 变量? 当用户停止滚动时,我想访问可见的单元格和自定义变量。
谢谢
【问题讨论】:
标签: ios objective-c uitableview tableview