jeudi 29 mai 2014

(IOS) When i want to make a button disable in a cell, its make many other disable


Vote count:

0




I am making an ios app. My issue is when I want to make a button disable in a cell, its make many other disable. I try many issue but I really don't know why. Tag of the button are ok, I think I don't use sender correctly. My code look like this :



- (IBAction) fiyeItPressed:(UIButton*)sender
{
UIButton *fiyeItButton = (UIButton*) sender;

[fiyeItButton setEnabled:NO];
NSLog(@"%d",[fiyeItButton tag]);

NSString *FiyeNumberString = [playlistVote objectAtIndex:sender.tag];
int FiyeInt = [FiyeNumberString intValue] + 1;
FiyeNumberString = [NSString stringWithFormat:@"%d",FiyeInt];
[playlistVote replaceObjectAtIndex:sender.tag withObject:FiyeNumberString];

[self saveForTable];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
PlaylistTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

cell.SongName.text = [playlistSongTitle objectAtIndex:indexPath.row];
cell.ArtisteName.text = [playlistSongArtist objectAtIndex:indexPath.row];
cell.numberOfVote.text = [playlistVote objectAtIndex:indexPath.row];
cell.VoteButton.tag = indexPath.row;

return cell;
}


asked 16 secs ago






Aucun commentaire:

Enregistrer un commentaire