(Réglé) Warning lors de la suppression d'une cellule

Ben77650Ben77650 Membre
juillet 2014 modifié dans API UIKit #1

Voila quand je souhaite supprimer une cellule de mon UITableView j'ai ce message qui s'affiche:


 


attempting to set a swipe to delete cell when we already have one....that doesn't seem good

 



 


Voila mon code:



- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.title=@Vos favoris;
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
     
    listOffer.delegate=self;
    listOffer.dataSource=self;
    
    listOffer.editing=true;
    listOffer.allowsSelectionDuringEditing=true;
}

- (void) reloadDateFromTable:(NSMutableArray*) reloadArray{
    _liste=reloadArray;
    [listOffer performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 20;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    DetailViewController* detail = [[DetailViewController alloc]init];
    [self.navigationController pushViewController:detail animated:NO];
}

#define kBgQueue dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)

static NSString* const UCellIdentifier = @CelluleOffre;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    CelluleOffre* cell = (CelluleOffre *)[tableView dequeueReusableCellWithIdentifier:UCellIdentifier];
    if(cell==nil){
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:UCellIdentifier owner:nil options:nil];
        cell = [nib objectAtIndex:0];
    }
       
    return cell;
}

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0)
    {
        return NO;
    }
    return YES;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if(editingStyle == UITableViewCellEditingStyleDelete)
    {
        [_liste removeObjectAtIndex:indexPath.row];
        [listOffer reloadData];
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}

Merci d'avance à  ceux qui m'aideront


Réponses

Connectez-vous ou Inscrivez-vous pour répondre.