2011-11-13 5 views
0

私のUITableViewでこの問題があります。一番下の行が上になるようにテーブルをドラッグすると、クラッシュします。私は基本的に私はそれを得ることができるように最下行をすべての方法をドラッグします。コードスニペットは以下の通りです:UITableView indexPath null問題

- (UITableViewCell *)tableView:(UITableView *)tableView 
     cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

    static NSString *CellIdentifier = @"Cell"; 

    UITableViewCell *cell = [table dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) { 
     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; 
    } 


    NSString *section = [[browseCategoriesDictionary allKeys] objectAtIndex:indexPath.section]; 
    NSArray *objectsForSection = [browseCategoriesDictionary objectForKey:section]; 

    NSString *cellValue = [objectsForSection objectAtIndex:indexPath.row]; 
    cell.textLabel.text = cellValue; 
    cell.backgroundColor = [UIColor colorWithRed:0x7C/255.0 green:0x7E/255.0 blue:0xBB/255.0 alpha:1]; 
    cell.detailTextLabel.numberOfLines = 3; 
    cell.detailTextLabel.textColor = [UIColor whiteColor]; 


    cell.detailTextLabel.text = [cellDescriptions objectAtIndex:indexPath.row]; 
    cell.imageView.image = [UIImage imageNamed:[cellIcons objectAtIndex:indexPath.row]]; 

    return cell; 
} 

みんなありがとう

+0

クラッシュログとは何ですか? –

答えて

0

あなたがnilの値を返すされていない使用しているさまざまなデータソースを確認してください、それがクラッシュする可能性があります。