我正在尝试向右滑动但是却出现了这个错误:
由于未捕获的异常而终止应用 'NSInvalidArgumentException',原因:' - [UITableViewCell setDelegate]:无法识别的选择器发送到实例0x7fbadb85d710'
这条线的错误:
cell.delegate = self;
cell.allowsMultipleSwipe = allowMultipleSwipe;
cell.rightSwipeSettings.transition = data.transition;
cell.rightExpansion.buttonIndex = data.rightExpandableIndex;
cell.rightExpansion.fillOnTrigger = YES;
cell.rightButtons = [self createRightButtons:data.rightButtonsCount];
我的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MGSwipeTableCell *cell ;
static NSString * reuseIdentifier = @"listAlbuns";
cell = [self.tblAlbum dequeueReusableCellWithIdentifier:reuseIdentifier];
if (!cell) {
cell = [[MGSwipeTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
}
NSString *sectionTitle = [albumSectionTitles objectAtIndex:indexPath.section];
NSMutableDictionary *sectionAlbuns = [albuns objectForKey:sectionTitle];
NSString *title = [sectionAlbuns objectForKey: [NSString stringWithFormat:@"%i", indexPath.row]];
NSMutableDictionary *album = [baseController getCurrentItemByTitle: albunsBD :title];
TestData *data = [tests objectAtIndex:indexPath.row];
NSInteger ID = [album objectForKey: @"1"];
cell.textLabel.text = [album objectForKey: @"2"];
cell.detailTextLabel.text = [[albumDAO selectArtistByAlbumID: ID] uppercaseString];
cell.imageView.image = [UIImage imageNamed: @"icones-categorias-album"];
cell.imageView.image = [albumDAO getThumb: ID];
cell.tag = [album objectForKey: @"1"];
cell.delegate = self;
cell.allowsMultipleSwipe = allowMultipleSwipe;
cell.rightSwipeSettings.transition = data.transition;
cell.rightExpansion.buttonIndex = data.rightExpandableIndex;
cell.rightExpansion.fillOnTrigger = YES;
cell.rightButtons = [self createRightButtons:data.rightButtonsCount];
return cell;
}
任何人都知道可能是什么?