Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //cell for row at indexpath
- ----------------------------------------
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *CellIdentifier = @"CellIdentifier";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (!cell) {
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
- cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
- }
- UILabel*titleUIL=(UILabel *) [cell.contentView viewWithTag:1];
- UILabel*no=(UILabel *) [cell.contentView viewWithTag:10];
- UILabel*numLab=(UILabel *) [cell.contentView viewWithTag:22];
- UITextView *txt=(UITextView *)[cell.contentView viewWithTag:21];
- txt.delegate = self;
- titleUIL.text = [[dicc valueForKey:[headersArray objectAtIndex:indexPath.section]]objectAtIndex:indexPath.row];
- UIButton *notappBTN=(UIButton *)[cell.contentView viewWithTag:112];
- UIButton *yesBTN=(UIButton *)[cell.contentView viewWithTag:100];
- UIButton *NOBTN=(UIButton *)[cell.contentView viewWithTag:111];
- // [yesBTN setBackgroundColor:[UIColor whiteColor]];
- //
- // [NOBTN setBackgroundColor:[UIColor redColor]];
- //
- // [notappBTN setBackgroundColor:[UIColor whiteColor]];
- NSInteger sectionCount =0;
- if (indexPath.section != 0)
- {
- for (int q =0; q< indexPath.section; q++) {
- sectionCount =sectionCount+[[dicc valueForKey:[headersArray objectAtIndex:q]]count];
- }
- sectionCount =sectionCount + indexPath.row;
- }
- else{
- sectionCount =sectionCount + indexPath.row;
- }
- if ([answersARRAY[sectionCount] isEqualToString:@"1"]) {
- [yesBTN setBackgroundColor:[UIColor colorWithRed:0.23 green:0.62 blue:0.23 alpha:1.0]];
- [NOBTN setBackgroundColor:[UIColor whiteColor]];
- [notappBTN setBackgroundColor:[UIColor whiteColor]];
- }
- else if ([answersARRAY[sectionCount] isEqualToString:@"-1"])
- {
- [NOBTN setBackgroundColor:[UIColor colorWithRed:1.00 green:0.02 blue:0.02 alpha:1.0]];
- [yesBTN setBackgroundColor:[UIColor whiteColor]];
- [notappBTN setBackgroundColor:[UIColor whiteColor]];
- }
- else if ([answersARRAY[sectionCount] isEqualToString:@"0"]){
- [NOBTN setBackgroundColor:[UIColor whiteColor]];
- [notappBTN setBackgroundColor:[UIColor colorWithRed:0.97 green:0.56 blue:0.02 alpha:1.0]];
- [yesBTN setBackgroundColor:[UIColor whiteColor]];
- }
- numLab.text= [NSString stringWithFormat:@"%i",indexPath.row +1];
- return cell;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement