小编Din*_*sh_的帖子

从'nsarray'分配给'nsmutablearray'的不兼容指针类型

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"self" ascending:YES];

sortedFloats = [Arr_distance sortedArrayUsingDescriptors:
                    [NSMutableArray arrayWithObject:sortDescriptor]];
Run Code Online (Sandbox Code Playgroud)

sortedFloatsNSMutableArray 在哪里,Arr_distance也是NSMutableArray

我收到警告Incompatible pointer types assigning to 'NSMutableArray ' from 'NSArray ' 仍然结果是正确的,但是警告是什么?

iphone nsarray ios4 ios

3
推荐指数
1
解决办法
3595
查看次数

如何从UITableView中删除所选行?

可能重复:
将表更改为编辑模式并删除普通ViewController中的行

我想从tableView中删除选定的行.我想为用户提供在他滑动或轻弹手指时删除行的功能.我知道编辑样式,它提供了一个带有-ve标志的圆形红色按钮.

我试过这段代码:

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 
{


[tableView beginUpdates];    
if (editingStyle == UITableViewCellEditingStyleDelete) {
    // Do whatever data deletion you need to do...
    // Delete the row from the data source
    [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationTop];      
}       
[tableView endUpdates];
[tableView reloadData];
}
Run Code Online (Sandbox Code Playgroud)

我得到删除按钮,但当我点击它SIGABRT错误就在那里.

iphone uitableview ios4 ios

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

ios ×2

ios4 ×2

iphone ×2

nsarray ×1

uitableview ×1