我使用的是自定義的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