【发布时间】:2013-06-17 04:55:01
【问题描述】:
我有一个表格视图,其中我有一个自定义单元格,其中我有另一个表格视图。在这个cellForRowAtIndexPath 方法中,我收到了这个错误no index path for table cell being reused 和cell gets disappeared after scroll。这是 indexpath 问题还是 cellidentifier 问题?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CustomCell";
CustomCell *customCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// __block CustomCell *customCell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// if (customCell == nil)
// {
// customCell = [[[CustomCell alloc] initWithFrame:CGRectMake(0, 0, 320, 416)] autorelease];
//
// }
[customCell prepareCell:arrCategory];
return customCell;
}
-(void)prepareCell:(NSArray *)arrCategory
{
if(mutArr != nil) {
[mutArr removeAllObjects];
mutArr = nil;
[mutArr release];
}
mutArr = [[NSMutableArray alloc] arrCategory];
[tblCusom reloadData];
}
我通过this SO ques 但我没有使用这个问题中使用的方法。那么我无法追踪它可能是什么问题。谷歌搜索后也没有发现同样的问题
【问题讨论】:
标签: objective-c ios6 uitableview custom-cell