私はuitableviewcellにチェックボックス画像を追加し、チェック画像とチェックされていない画像を切り替えるという問題を抱えています。uitableviewcellのチェックボックス画像を切り替える
私の単純なコードは次のとおりです。
-(UITableViewCell *)tableView:(UITableView *)todoTable cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";
UITableViewCell *cell = [self.todoTable dequeueReusableCellWithIdentifier: SimpleTableIdentifier];
if (!cell) {
cell = [[[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault reuseIdentifier:SimpleTableIdentifier] autorelease];
}
cell.textLabel.text = [self.todoList objectAtIndex:indexPath.row];
return cell;
}
と私はhereから
に溶液中で追加しようとする。しかし、私は interface ToggleImageControl : UIControl
を入れなければならどこ私はそれを置くと仮定知りません私のviewcontrollerと同じヘッダファイルですか?
も私はこの問題を解決することができますどのように、私は理由は見つからなかったインタフェースの実装のToggleImageControl
参照エラーが表示されますが、上記の私のコードに
ToggleImageControl *toggleControl = [[ToggleImageControl alloc] initWithFrame: <frame>];
toggleControl.tag = indexPath.row; // for reference in notifications.
[cell.contentView addSubview: toggleControl];
に入れてみては?
ありがとうございました。