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 6188235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:11:52+00:00 2026-05-24T02:11:52+00:00

iam developing one application.In that i place the imageview in every tableview cell like

  • 0

iam developing one application.In that i place the imageview in every tableview cell like

-(UITableViewCell *)tableView:(UITableView *)tableView
        cellForRowAtIndexPath:(NSIndexPath *)indexPath {

          static NSString *CellIdentifier = @"Cell";
          UITableViewCell *cell = [tableView
                    dequeueReusableCellWithIdentifier:CellIdentifier];

    itemimageview=[[UIImageView alloc]initWithFrame:CGRectMake(5, 8, 75, 70)];
    itemimageview.image=[UIImage imageNamed:@"thumb_mdpi.png"];
    itemimageview.userInteractionEnabled = YES;
    [cell.contentView addSubview:itemimageview];
    return cell;
}

And when u click any row we get the image from our iPhone camera.For that i write the below code in didSelectROw method.

UIImagePickerController *imagePicker = [[[UIImagePickerController alloc] init]
                                                                  autorelease];
imagePicker.sourceType=UIImagePickerControllerSourceTypeCamera;
//imagePicker.allowsImageEditing = NO;
imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];

After i use the UIIMagePickerController delegate method like

- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info {
    UIImage* image = [info objectForKey:UIImagePickerControllerOriginalImage];

    NSLog(@"image selected");
    itemimageview.image =image;
    [self dismissModalViewControllerAnimated:YES];
}

But my problem is after selecting the image,that image will be appear at last cell only.If u select first row and take the image then that image will be appear at last row.So please tell me what are the changes in my code for getting the image for every row.

  • 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-05-24T02:11:53+00:00Added an answer on May 24, 2026 at 2:11 am

    You can achieve this by following these steps:
    1.First when the user clicks a cell, store the row number (indexPath.row) in an integer variable.
    2.Once you have acquired the image from the camera,store it in a UIImage.
    3.Now you know the row to be updated and you have ur image.Call reloadData method of the UITableView at the end of the didFinishPickingMediaWithInfo delegate method.
    4.The reloadData method will subsequently call the cellForRowAtIndexPath method. In that have a condition like this:

    if(indexPath.row==clickedRow){
      //Create the imageView here and then assign the image obtained from the camera to it.
      imageView.image=cameraImage;
      [cell.contentView addSubView:imageView];
    

    }
    where clickedRow is the integer variable which holds the row number clicked by the user in didSelectRowAtIndexPath method.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing iPhone application and In that application I've one TableViewController , and
I am developing a C# program, and i have one function that consumes too
I am developing an application that needs to read back the whole frame from
I am developing an application suite that consists of several applications which user can
I am developing a CLI application in Ruby, and I'd like to allow configuration
I am developing a library and an application that uses the library in Python
I am developing a Joomla component and one of the views needs to render
I am developing an application to install a large number of data files from
I am developing a website that relies much on XML data. The web site
I am developing a GPL-licensed application in Python and need to know if the

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.