Iphone UITableViewCell事件中的UIButton不工作
我在网上到处都能看到这个问题,列出的解决方案都不适合我 我已将UIButton添加到IB中的UITableViewCell。我已将自定义UITableViewCell类指定给UITableViewCell。我的自定义UITableViewCell类有一个iAction,我正在连接到内部修补事件(我尝试了其他事件,但它们都不起作用),但从未调用iAction函数 UITableViewCell中没有其他内容,我已将UIButton直接添加到内容视图中。而且一切都启用了用户交互!就这么简单,我没有什么复杂的事情 停止按钮工作的UITableViewCell是什么 编辑:通过请求初始化UITableViewCells的代码,自定义类称为DownloadCellIphone UITableViewCell事件中的UIButton不工作,iphone,uitableview,uibutton,Iphone,Uitableview,Uibutton,我在网上到处都能看到这个问题,列出的解决方案都不适合我 我已将UIButton添加到IB中的UITableViewCell。我已将自定义UITableViewCell类指定给UITableViewCell。我的自定义UITableViewCell类有一个iAction,我正在连接到内部修补事件(我尝试了其他事件,但它们都不起作用),但从未调用iAction函数 UITableViewCell中没有其他内容,我已将UIButton直接添加到内容视图中。而且一切都启用了用户交互!就这么简单,我没有什
- (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;
}
您是否已将此代码放入表视图中。? tableView.delegate=self; dataSource=self 谢谢,
bharath您是否已将此代码置于表格视图中。? tableView.delegate=self; dataSource=self 谢谢,
bharath问题似乎与我过于频繁地更新表格单元格有关,因此这中断了与单元格本身的任何交互问题似乎与我过于频繁地更新表格单元格有关,因此,这中断了与单元格本身的任何交互您的
iAction
方法是在单元格子类中定义的还是在视图控制器中定义的?如何在表格视图中初始化单元格?我已经编辑了这个问题以包含您的问题!感谢您在单元格子类或视图控制器中定义的iAction
方法?如何在表格视图中初始化单元格?我已经编辑了这个问题以包含您的问题!谢谢