我正在尝试删除一些项目,但我收到了这个 NSException:
'NSRangeException',原因:' * -[__NSArrayM objectAtIndex:]:索引 2 超出范围 [0 .. 1]'
这是我的代码:
-(void)deletePressed:(id)sender {
if (data.count > 0) {
NSString *path = [NSHomeDirectory() stringByAppendingString:@"/Documents/Galeria/"];
NSFileManager *manager = [NSFileManager defaultManager];
for (NSIndexPath *indexPath in itensSelecionados) {
NSString *result = [path stringByAppendingFormat:@"%@", [[manager contentsOfDirectoryAtPath:path error:nil] objectAtIndex:indexPath.row]];
[manager removeItemAtPath:result error:nil];
}
[self viewWillAppear:YES];
}}
任何人都可以帮忙吗?