基本的に、各セルに uiprogressview と uiswitch を含む uitableview があります。スイッチを切り替えると、progressview の可視性が切り替わります。
しかし。
行のスイッチを切り替えると:0. 行:0 AND 行:11 のプログレスビューが表示されます。
私のスイッチはこれを持っています: [(UISwitch *)cell.accessoryView addTarget:self action:@selector(PrefetchStudy:) forControlEvents:UIControlEventValueChanged];
アクションは次のとおりです。
-(void)PrefetchStudy:(id)sender
{
UISwitch *tmpSwitch = (UISwitch*)sender;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:tmpSwitch.tag inSection:0];
CustomCell *cell = (CustomCell *)[self.tableview cellForRowAtIndexPath:indexPath];
NSString *tmp = cell.patient_name.text;
NSLog(@"This is the patient name of the selected row: %@", tmp);
if(tmpSwitch.on)
{
cell.progressBar.hidden = NO;
}
else
{
cell.progressBar.hidden = YES;
}
}
なぜこれが起こっているのかについての提案はありますか?