у меня есть две совершенно одинаковые проблемы 1) у меня есть UIButton в ячейке, которая вызывает IBAction:
- (IBAction)deleteFriend:(id)sender
{
CGPoint buttonPosition = [sender convertPoint:CGPointZero toView:self->table];
NSIndexPath *indexPath = [self->table indexPathForRowAtPoint:buttonPosition];
if (indexPath != nil)
{
UITableViewCell *cell = [self->table cellForRowAtIndexPath:indexPath];
[UIView animateWithDuration:0.3 animations:^{
cell.alpha = 0;
} completion: ^(BOOL finished) {
cell.hidden = YES;
button.hidden = YES;
}];
}
Так что в основном я хотел бы подтвердить предупреждение перед IBAction, но вот проблема. Я не знаю, как передать отправителя в buttonIndex UIAlertView, чтобы он мог выполнить работу этого IBAction.
2) Здесь в коде я говорю ячейке (ячейка в IBAction) скрыть, а также кнопку, которую я определил в cellforRowatIndexPath:
button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:buttonImage forState:UIControlStateNormal];
button.frame = CGRectMake(272.0f, 15.0f, 30.0f, 30.0f);
[cell button];
[button addTarget:self action:@selector(deleteFriend:)
forControlEvents:UIControlEventTouchUpInside];
но каким-то образом он случайно скрывает другую кнопку в других ячейках. Почему, черт возьми, он просто не прячется в одной ячейке?
заранее спасибо !