SEND TABLE VIEW CELL VALUE ON BUTTON ACTION IN IOS

Eric Martell

Total Post:9

Points:63
Posted by  Eric Martell
 546  View(s)
Ratings:
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.

  1. Tarun Kumar

    Post:214

    Points:1642
    Re: Send table view cell value on button action in IOS

    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;
    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!