Я вижу эту проблему по всей сети, и ни одно из перечисленных решений не работает для меня!
Я добавил UIButton в UITableViewCell в IB. Я назначил пользовательский класс UITableViewCell для UITableViewCell. Мой пользовательский класс UITableViewCell имеет IBAction, который я подключаю к событию Touch Up Inside (я пробовал другие события, которые все они не работают), но функция IBAction никогда не вызывается!
В UITableViewCell больше ничего нет, я добавил UIButton непосредственно в представление содержимого. И все имеет взаимодействие с пользователем включен! Это так просто, что у меня ничего сложного не происходит!
Что такое UITableViewCell, который останавливает работу кнопок?
РЕДАКТИРОВАТЬ: По запросу код, где я инициализирую свои UITableViewCells, пользовательский класс называется DownloadCell
- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"DownloadCell";
DownloadCell *cell = (DownloadCell *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
UIViewController * cellController = [[UIViewController alloc] initWithNibName:@"DownloadCell" bundle:nil];
cell = (DownloadCell *)cellController.view;
[cellController release];
}
SoundLibrarianIPhoneAppDelegate * del = (SoundLibrarianIPhoneAppDelegate *)[UIApplication sharedApplication].delegate;
DownloadQueue * dq = del.downloadQueue;
DownloadJob * job = [dq getDownloadJob: indexPath.row];
[job setDelegate:self];
SoundInfo * info = [job sound];
NSArray * seperated = [info.fileName componentsSeparatedByString: @"."];
NSString * displayName = [seperated objectAtIndex:0];
displayName = [displayName stringByReplacingOccurrencesOfString:@"_" withString:@" "];
displayName = [displayName capitalizedString];
[cell.titleLabel setText: displayName];
cell.progressBar.progress = job.percentCompleted;
[cell.progressLabel setText: [job getProgessText]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.userInteractionEnabled = YES;
[cell setDelegate:self];
return cell;
}