我有一个表视图的iOS的TableView如何访问自定义单元格变量
- (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];
}
我访问的tableview细胞像这样:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
for (NSIndexPath *path in [tableView indexPathsForVisibleRows]) {
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path];
}
//I want to access cell.ChannelID //
}
我如何可以访问的channelID变量? 当用户停止滚动时,我想访问可见的单元格和自定义变量。
谢谢
什么是“对象”? – Moxy