title: UICollectionView 0th index changing color of complete view
body: <p>I am using a UICollectionViewController to display days with an orange background and when the user clicks on that day the background of that day should change to grey. The program works fine for everyday except for Monday where the index path.row value is 0 (its the first item in the series). It changes the background of all the views including itself to orange</p>
  
  <pre><code>    @implementation DayControllerViewController
      - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];  
      return self;}
  
      -(void)viewDidLoad{
      [super viewDidLoad];
      dayLabels =  [NSArray arrayWithObjects:@"Monday", @"Tuesday", @"Wednesday", @"Thursday", @"Friday", @"Saturday", @"Sunday", nil];
      //[self.collectionView reloadData];    
  }
  
      -(void)didReceiveMemoryWarning{
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
      -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
      return 1;
  }
  
      -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
      return dayLabels.count;
  }
  
      UICollectionViewCell *cell;
  
      -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
      static NSString *identifier = @"Cell";
  
      cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
  
      UILabel *recipeImageView = (UILabel *)[cell viewWithTag:100];
      [recipeImageView setText:  [dayLabels objectAtIndex:indexPath.row]];
      [recipeImageView setTag : indexPath.row];
  
      UIColor *orangecol = [UIColor colorWithRed:236.0/255 green:85.0/255 blue:50.0/255 alpha:1];
  
      [recipeImageView setBackgroundColor:orangecol];
      NSLog(@"Label Tag: %i",recipeImageView.tag);
      return cell;
  
  }
  
      -(BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      NSLog(@"this is caled");
      return YES;
  }
  
  
  - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      UIColor *orangecol = [UIColor colorWithRed:236.0/255 green:85.0/255 blue:50.0/255 alpha:1];
  
      UIColor *greycol = [UIColor colorWithWhite:0 alpha:0.3];
  
      NSLog(@"DidSelect Called");
      UILabel* lbl = (UILabel*)[collectionView viewWithTag:indexPath.row];
      NSLog(@"Label With Tag: %i",lbl.tag);
      if([lbl.backgroundColor isEqual: orangecol]){
          NSLog(@"lbl Clicked %@",lbl.text);
          [lbl setBackgroundColor:greycol];
      }
      else {
          [lbl setBackgroundColor:orangecol];
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I would have posted images had i got enough reputations. Thanks</p>