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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:34:55+00:00 2026-05-15T04:34:55+00:00

I have the following image xml tag in which image path is stored NSString

  • 0

I have the following image xml tag in which image path is stored

NSString *imgstring =[[blogEntries objectAtIndex: blogEntryIndex1] objectForKey: @"image"];

now i want to display this image in UITAble cell by following method

cell.textLabel.text=imgstring;

i am just getting path on the cell not actual image how should i display image

  • 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-15T04:34:56+00:00Added an answer on May 15, 2026 at 4:34 am

    Of course you’re getting text displayed – you’re setting the text property of a UILabel to a string 🙂 How would it know you wanted it to display an image?

    You want something like

    cell.imageView.image = [UIImage imageNamed:imgstring];
    

    Have a look at the UITableViewCell documentation for more details

    However, this will only work for images in your project – for external images you will have to do a little more work.

    NSString *imgstring =[[blogEntries objectAtIndex: blogEntryIndex1] objectForKey: @"image"];
    NSURL *url = [NSURL URLWithString:imgstring];
    NSData *data = [NSData dataWithContentsOfURL:url];
    UIImage *img = [[UIImage alloc] initWithData:data];
    

    However, this will block your app until the image is loaded. Instead you might need to load the images is the background :

        // Tell your code to load the image for a cell in the background
        NSString *imgstring =[[blogEntries objectAtIndex: blogEntryIndex1] objectForKey: @"image"];
        NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:cell, @"cell", imgstring, @"imgstring", nil];
        [self performSelectorInBackground:@selector(loadImage:) withObject:dict];
    
    - (void) loadImage:(id)object {
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    
        // Get the data to pass in
        NSDictionary *dict = (NSDictionary *)object;
    
        // Get the cell and the image string
        NSString *imgstring = [dict objectForKey:@"imgstring"];
        UITableViewCell *cell = [dict objectForKey:@"cell"];
    
        NSURL *url = [NSURL URLWithString:imgstring];
        NSData *data = [NSData dataWithContentsOfURL:url];
        UIImage *img = [[UIImage alloc] initWithData:data];
    
        [pool release];
    }
    

    But you’re going to run into threading problems if you’re not careful with this 🙂

    If you get any other problems, post another comment and I’ll try to help!

    PS I’ve not tested this code, just typed it straight in so there might be typos, sorry!

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

Sidebar

Related Questions

I have following code for loading image from url in xml parsing endElement method
Assuming you have the following XML: <?xml version=1.0 encoding=utf-8?> <content> <info> <media> <image> <info>
I have the following rectangular image to be set in my application. Now I
I want to read xml file which looks like the following ... I have
I have the following setup. In my xml i have a bunch of image
I have the following in my main.xml the image marker does not fill the
I have the following problem: int index=6; imageView.image=[imageArray objectAtIndex:index]; NSLog(@%@,[imageArray objectAtIndex:index]); If I run
I have the following xml. Given, a UID , Manufacturer Name and Image Layout
I have the following simple kml which references an image file that I would
I have the following sample xml: <data> <products> <product> <section>Red Section</section> <images> <image>img.jpg</image> <image>img2.jpg</image>

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.