我使用的是自定义的uitablecellview像我以前做的。但是,不幸的是,这个时候,一个新的细胞appears.So,相同的代码部分已经非常完美许多抛出一个异常以前的时间。唯一的区别是我放入细胞的图像质量非常高。 你有什么想法?或者我应该多解释一下? 编辑 一些代码:错误时,“新的”自定义uitablecellview apprear
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CellView";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"SPViewControllCell" owner:self options:nil];
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell=cellView;
self.cellView=nil;
}
UILabel *itemTitle=(UILabel*)[cell viewWithTag:1];
[itemTitle setFont:[UIFont fontWithName:@"Renaissance" size:24]];
itemTitle.text=[titles objectAtIndex:indexPath.row];
UIImageView *img=(UIImageView*)[cell viewWithTag:2];
img.image=[images objectAtIndex:indexPath.row];
return cell;
}
异常: “ 'NSInvalidArgumentException' 的,理由是: ' - [UITableViewCell的objectAtIndex:]:无法识别的选择发送到实例0x5f36be0' ” 谢谢您。
什么异常?这可能是内存问题或文件格式问题。 – MusiGenesis 2011-01-06 15:53:07
有机会看到一些代码?或抛出什么异常?也使用沉重的图像可能表明您遇到内存不足的问题 – Vladimir 2011-01-06 15:53:30
似乎像标题或图像已被回收,其中一个有它的单元格地址使用 – CiNN 2011-01-06 15:59:50