Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9073901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:31:20+00:00 2026-06-16T18:31:20+00:00

I have a table view and UIView.Table view cell is having cells with image.I

  • 0

I have a table view and UIView.Table view cell is having cells with image.I want when perticuler cell is selected the corresponding image should appear in “UIImage object” in UIView.

In table view class:

//I'm getting temp image as following(in my "cellForRowAtIndexPath" method)
  if(indexPath.row == 0)
    {
        [[cell imageView]setImage:[UIImage imageNamed:@"greekChickenSalad.png"]];
        tempImage = [UIImage imageNamed:@"greekChickenSalad.png"];
    }

 -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"SubRecipeDescriptionSegue"])
{
     RecipeDescriptionViewController *rdVC;
    rdVC = segue.destinationViewController;
    rdVC.parentIndexRDVC = descriptionIndexPath;
    rdVC.DescriptionLabel = (UILabel*)subRecipeSelected;
    rdVC.image = tempImage;

}

}

In UIView, LoadView method adding image like following:

NSData *imageDataString = UIImagePNGRepresentation(image);
NSString *imageNamedContent = [[NSString alloc]initWithBytes:[imageDataString bytes] length:[imageDataString length] encoding:NSASCIIStringEncoding];
UIImage *image1 = [UIImage imageNamed:imageNamedContent];
UIImageView *imageView = [[UIImageView alloc]initWithImage:image1];
imageView.frame = CGRectMake(30,30, 250, 100);
[self.view addSubview:imageView];

In above code, I’m converting image to NSString([UIImage imageNamed:imageNamedContent]) – Is this correct?

If not, How can I do this?

Note: Segue is working fine if I’m passing table cell’s text to a label in UIView.

Hope my question is clear.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:31:21+00:00Added an answer on June 16, 2026 at 6:31 pm

    Change:

    NSData *imageDataString = UIImagePNGRepresentation(image);
    NSString *imageNamedContent = [[NSString alloc]initWithBytes:[imageDataString bytes] length:[imageDataString length] encoding:NSASCIIStringEncoding];
    UIImage *image1 = [UIImage imageNamed:imageNamedContent];
    UIImageView *imageView = [[UIImageView alloc]initWithImage:image1];
    

    Into:

    UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
    


    Also you need to get the image of the current cell and send it with the performSegueWithIdentifier:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
        [self performSegueWithIdentifier:@"SubRecipeDescriptionSegue" sender:cell.imageView.image];
    }
    

    Then you need to update your prepareForSegue method:

    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        if ([segue.identifier isEqualToString:@"SubRecipeDescriptionSegue"])
        {
            UIImage *selectedImage = (UIImage*)sender;
    
            RecipeDescriptionViewController *rdVC;
            rdVC = segue.destinationViewController;
            rdVC.parentIndexRDVC = descriptionIndexPath;
            rdVC.DescriptionLabel = (UILabel*)subRecipeSelected;
            rdVC.image = selectedImage;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Table View Controller with cells. I want to update the text
I have a table view with numerous cells. When I press one, a tick
I have a table view controller with (among others) a cell that is to
I have a table view with a custom cell ( UISwitch on every cell
I have a table view controller with custom cells. In those cells i added
I have a table view that is managed by an NSFetchedResultsController. I am having
hello every one i have table view with one cell,and i make on this
I have a custom view in a custom table cell. Every time a specific
I have so many cells in table view say nearly 500. Each and every
I have a table going where each cell has a UIView in it that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.