title: How Can I push the image of selected Collection View Cell to another View Controller?
body: <p>Can anyone please help me... I already have a collection view that displays all images from a free database on Parse.com. I need to pass the image of the selected cell to another view controller. I've already have the code for prepareForSegue, my problem is that I can't get the value of the selected cell. here's my codes..</p>
  
  <pre><code>-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
      return 1;
  }
  
  -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
      return [imageArray count];
  }
  
  
  -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
  
      static NSString *cellIdentifier = @"imageCell";
      GalleryCell *cell = (GalleryCell *)[collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
  
      PFObject *imageObject = [imageArray objectAtIndex:indexPath.row];
      PFFile *imageFile = [imageObject objectForKey:@"parseImage"];
  
      cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"photo-frame.png"]];
  
       cell.loadingSpinner.hidden = NO;
       [cell.loadingSpinner startAnimating];
  
      [imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
          if (!error) {
              cell.parseImage.image = [UIImage imageWithData:data];
              [cell.loadingSpinner stopAnimating];
              cell.loadingSpinner.hidden = YES;
          }
      }];
  
      return cell;
  }
  
  
  
  - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
  
  // should I put anything here? the collection view display images even its blank
  
  }
  
  //segue transfer data
  -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  
      UINavigationController *nav = [segue destinationViewController];
      DetailedVC *transferViewController = (DetailedVC *)nav.topViewController;
  
      NSLog(@"prepareForSegue: %@", segue.identifier);
      if([segue.identifier isEqualToString:@"detailView"])
      {
          //here is my problem... what should I put here????
      }
  }
  </code></pre>
  
  <p>I've already put codes to viewDidLoad of the recipient view controller </p>