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
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
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.
However, this will block your app until the image is loaded. Instead you might need to load the images is the background :
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!