Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- M13Checkbox *CheckBox = nil;
- UILabel *QuestionLbl = nil;
- static NSString *CellIdentifier = @"Cell";
- UITableViewCell *cell =(UITableViewCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
- CheckBox = [[M13Checkbox alloc] initWithFrame:CGRectMake(9,7,26,26)];
- CheckBox.tag = 1000;
- [CheckBox addTarget:self action:@selector(CheckBoxSelected:) forControlEvents:UIControlEventValueChanged];
- [cell.contentView addSubview:CheckBox];
- QuestionLbl = [[UILabel alloc] initWithFrame:CGRectMake(40,0,280,40)];
- [cell.contentView addSubview:QuestionLbl];
- QuestionLbl.tag = 2000;
- QuestionLbl.textColor = TopTintColor;
- QuestionLbl.font = kAppFontWithSize(13);
- QuestionLbl.numberOfLines = 2;
- }else
- {
- CheckBox = (M13Checkbox *) [cell.contentView viewWithTag:1000];
- QuestionLbl = (UILabel *) [cell.contentView viewWithTag:2000];
- }
- ClsSymptom *SymptomObj = nil;
- switch (indexPath.section) {
- case 0:
- {
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- SymptomObj = (ClsSymptom *)[_FirstSecArr objectAtIndex:indexPath.row];
- CheckBox.enabled = YES;
- }
- break;
- case 1:
- {
- SymptomObj =(ClsSymptom *) [_SecondSecArr objectAtIndex:indexPath.row];
- if ([SymptomObj.Name isEqualToString:AddSymptomText])
- {
- CheckBox.enabled = NO;
- cell.selectionStyle = UITableViewCellSelectionStyleGray;
- }else
- {
- CheckBox.enabled = YES;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- }
- break;
- case 2:
- {
- SymptomObj =(ClsSymptom *) [_ThirdSecArr objectAtIndex:indexPath.row];
- QuestionLbl.text = SymptomObj.Name;
- cell.selectionStyle = UITableViewCellSelectionStyleGray;
- CheckBox.enabled = YES;
- }
- break;
- case 3:
- {
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- // SymptomObj = [_FourthSecArr objectAtIndex:indexPath.row];
- CheckBox.enabled = YES;
- }
- break;
- default:
- break;
- }
- if(indexPath.section==3)
- {
- if (indexPath.row==0)
- {
- QuestionLbl.text = @"Yes";
- [CheckBox setCheckState:TreatmentSelected];
- }
- else
- {
- QuestionLbl.text = @"No";
- [CheckBox setCheckState:NoTreatmentSelected];
- }
- }else{
- QuestionLbl.text = SymptomObj.Name;
- [CheckBox setCheckState:SymptomObj.isSelected];
- }
- return cell;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement