Advertisement
Guest User

Untitled

a guest
May 3rd, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  2.     static NSString* identifir = @"Cell";
  3.     static NSString* detailIdentifier = @"detailCell";
  4.     if([self.checkedPaths count] == 0 && !(self.isOpenDoctors))
  5.     {
  6.         StuffCell* cell = [tableView dequeueReusableCellWithIdentifier:identifir];
  7.         UIView *bgColorView = [[UIView alloc] init];
  8.         bgColorView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"checktt@2x.png"]];
  9.        [cell setSelectedBackgroundView:bgColorView];
  10.  
  11.         if(cell == nil)
  12.         {
  13.             cell = [[StuffCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifir];
  14.         }
  15.        
  16.        
  17.         [cell setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"uncheck@2x.png"]]];
  18.        
  19.         cell.labelStuff.text = [self.mainArray objectAtIndex:indexPath.row+self.numberOfCheckedRow-self.numberOfCheckedRow];
  20.         cell.imageArrow.image = [UIImage imageNamed:@"arrow_down@2x.png"];
  21.         cell.labelStuff.textColor = [ViewController colorWithHexString:@"235977"];
  22.         return cell;
  23.  
  24.     }
  25.     else if (self.isOpenDoctors == YES && ![self.checkedPaths containsObject:indexPath])
  26.     {
  27.         StuffCell* cell = [tableView dequeueReusableCellWithIdentifier:identifir];
  28.         if(cell == nil)
  29.         {
  30.             cell = [[StuffCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifir];
  31.         }
  32.        
  33.        
  34.         [cell setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"uncheck@2x.png"]]];
  35.         cell.labelStuff.text = [self.mainArray objectAtIndex:indexPath.row];
  36.         cell.imageArrow.image = [UIImage imageNamed:@"arrow_down@2x.png"];
  37.         cell.labelStuff.textColor = [ViewController colorWithHexString:@"235977"];
  38.         return cell;
  39.  
  40.        
  41.     }
  42.    
  43.    
  44.     else
  45.     {
  46.         DetailStuffCell* cell = [tableView dequeueReusableCellWithIdentifier:detailIdentifier];
  47.  
  48.         if(cell == nil)
  49.         {
  50.             cell = [[DetailStuffCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifir];
  51.         }
  52.        
  53.         [cell setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"sotr@2x.png"]]];
  54.         cell.labelDetail.textColor = [ViewController colorWithHexString:@"235977"];
  55.         cell.labelDetailTwo.textColor = [ViewController colorWithHexString:@"235977"];
  56.         cell.selectionStyle = UITableViewCellSelectionStyleNone;
  57.         [cell.avaView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"ava_mini@2x.png"]]];
  58.         Doctor* doctor = [self.mainArray objectAtIndex:indexPath.row];
  59.         cell.avaImage.image = [UIImage imageNamed:doctor.avatarName];
  60.         cell.labelDetail.text = doctor.name;
  61.         cell.labelDetailTwo.text = doctor.aboutHim;
  62.        // cell.userInteractionEnabled = NO;
  63.        // cell.labelDetail.text = [self.mainArray objectAtIndex:indexPath.row];
  64.    // NSLog(@"%@",cell.labelDetail.text);
  65.                                                                        
  66.         return cell;
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement