0
不知道什麼是錯我的表視圖,我有一本字典(該字典由sqlite的操作創建),我試圖創建細胞這樣iphone:UITableView的崩潰應用
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
MyIdentifier = @"tblCellView";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if(cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
cell = aCustomCell;
aCustomCell=nil;
}
NSMutableDictionary *tempDictionary=[[NSMutableDictionary alloc] init];
tempDictionary=[offendersNamesList objectForKey:[NSString stringWithFormat:@"key%d", indexPath.row+1]];
[[cell offendersImageView] setImage:[UIImage imageNamed:@"contact.png"]];
[cell.offendersNameLbl setText:[tempDictionary objectForKey:@"name"]];
[cell.offendersViolation setText:[tempDictionary objectForKey:@"offence"]];
[tempDictionary release];
//[cell setLabelText:[arryData objectAtIndex:indexPath.row]];
return cell;
}
所有的項目都顯示正確,但當我滾動表視圖時,應用程序崩潰可以幫助我嗎?