私は 1 つのボタンと 1 つの uilabel を持つカスタム TableViewCell を持っています。実際、このダウンロードイベントはどこでどのように処理するのですか?
これは私のカスタムセルです。私はこのように処理しようとしましたが、エラーが発生しました
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '- [downloadPageCell downloadSong:]: unrecognized selector sent to instance 0x94b1490'
*** First throw call stack:
私のコードはここにあります
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
downloadPageCell *newCell = nil;
newCell = [tableView dequeueReusableCellWithIdentifier:identifier];
if(newCell == nil)
{
NSLog(@"newCell ===================");
NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:@"downloadPageCell" owner:self options:nil];
newCell = [ nibViews lastObject];
}
newCell.titleText.text=[URLTitle objectAtIndex:indexPath.row];
[newCell.downloadButton addTarget:self action:@selector(DOWNLOAD:) forControlEvents:UIControlStateNormal];
return newCell;
}
セルからボタン イベントを処理するための実際のコードは何ですか?
編集
-(void)downloadButtonPressed:(UIButton*)sender
{
NSLog(@"download button pressed");
}