« first day (1372 days earlier)      last day (2745 days later) » 

5:11 AM
gist: c781339b11280e45b9180fcf0d4925bc, 2016-10-27 05:10:06Z
//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;
    
}
 
6:03 AM
1 message moved from iOS Developer Family
 
 
10 hours later…
3:43 PM
 

« first day (1372 days earlier)      last day (2745 days later) »