Objective c UITableView索引XPath空问题

Objective c UITableView索引XPath空问题,objective-c,xcode,uitableview,uiviewcontroller,Objective C,Xcode,Uitableview,Uiviewcontroller,我的UITableView有这个问题。当我拖动桌子使最下面的一行向上移动一半时,会发生碰撞。当我基本上把最下面一行拖到最上面的时候。代码片段如下所示: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITabl

我的UITableView有这个问题。当我拖动桌子使最下面的一行向上移动一半时,会发生碰撞。当我基本上把最下面一行拖到最上面的时候。代码片段如下所示:

- (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;
}

谢谢大家

请检查您正在使用的不同数据源没有返回零值,这可能会导致崩溃