0
我正在做一个小概念复选框。其实,我把复选框图像放在表格单元格中,但我无法理解,如何选择特定的复选框并在表格视图中获取单元格的值,任何主体都可以通过解决这个问题来帮助我。提供编码表视图的屏幕截图,如何选择特定的复选框在插入在表格单元接口生成器中的复选框iphone
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"in table view cell for row at index");
RequestSongSelectingCell *cell = (RequestSongSelectingCell *) [tableView dequeueReusableCellWithIdentifier:@"requestsingcell"];
if (cell==nil)
{
[[NSBundle mainBundle] loadNibNamed:@"RequestSongSelectingCell" owner:self options:nil];
NSLog(@"start");
cell=requestingCell;
NSLog(@"end");
}
NSDictionary *dict=[self.array objectAtIndex:indexPath.row];
NSString *artistname=[dict objectForKey:@"artist"];
NSLog(@"artistname is %@",artistname);
cell.artistName.text=artistname;
NSString *songtitle=[dict objectForKey:@"title"];
NSLog(@"songtitle is %@",songtitle);
cell.artistTitle.text=songtitle;
return cell;
}
-(IBAction)checkButtonPressed:(id)sender
{
NSLog(@"check box button pressed");
requestingCell.checkBoxButton.imageView.image=[UIImage imageNamed:@"checkbox-checked.png"];
}
感谢和问候,
吉里什
嗨Vaibhav的感谢乌拉圭回合的响应它的工作,但我有当我当上点击是在butoon图像不能改变一个问题(刻度)你可以指导我这样做。 – girish 2011-03-24 07:19:52
这很棘手,我们维护标签中单元格的索引,因此不能将其用于选定或未选定的值。您可以将标签设置为正面或负面。对未选中的选择为正值,对选中的为负值。这可以成为解决这个问题的方法之一。我将编辑相同的代码。 – 2011-03-24 07:28:43
嗨vaibhav感谢它的工作..可以请你转发我的邮件ID给我。我的邮箱ID是[email protected] – girish 2011-03-24 07:53:55