How to load image from NSMutableArray

Posted by pbcoder on Stack Overflow See other posts from Stack Overflow or by pbcoder
Published on 2010-03-28T11:18:51Z Indexed on 2010/06/17 13:03 UTC
Read the original article Hit count: 157

Filed under:
|

I want to load the image URL from my NSMutableArray. Here is my Code:

id path = (NSString *)[[stories objectAtIndex: storyIndex] objectForKey: @"icon"];
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data cache:NO];

If I use: id path = @"http://www.xzy.de/icon.png"; it´s all right, but not if I want to extract the imageURL from my Array

Anyone who can help me? Thanks!

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about nsmutablearray