Home > DeveloperSection > Forums > Send table view cell value on button action in IOS
Eric Martell
Eric Martell

Total Post:9

Posted on    November-28-2015 12:56 AM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 483  View(s)
Rate this:

I have created a table view that lists some records in table view cell.
Now, I want to send cell value whenever I click on Button.

If any one have solution then please reply me.

Tarun Kumar

Total Post:214

Posted on    November-30-2015 2:34 AM

You can use this code to display image grid into UICollectionView.
One thing is very important to do is that don't forget to set the delegate in collection.

this is the code I am using in our application, and in your xib file add UIImageView on your CollectionViewCell and also tag value to 100.

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
   return [imgArray count];

- (NSInteger)collectionView:(UICollectionView *)collectionView  numberOfItemsInSection:(NSInteger)section
   return 1;

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
   static NSString *identifier = @"Cell";
   ImagesCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];

   UIImageView *img = (UIImageView *)[cell viewWithTag:100];
   img.image = [imageArray objectAtIndex:indexPath.row];

   return cell;

Don't want to miss updates? Please click the below button!

Follow MindStick