i want to display image in uitableviewcell, for that in uitableview my data is fetch from webservice and i use xmlparsing for that i.e.
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{
}
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
}
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
}
Now , If My XML Ouput Return Image Path Name,,
Like hhtp://www.abc.com/a.png
then uitableviewcell can display image ?
If Not Then How I Can Display Imag开发者_如何学Goe...
NSData *data = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://www.abc.com/a.png"]];
UIImage *img = [[UIImage alloc] initWithData:data];
cell.imageView.image = img;
[img release];
[data release];
id path = @"http://www.abc.com/a.png";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data cache:NO]
cell.imageView.image = img;
精彩评论