Suppose you had something like:
NSURL *baseURL = [NSURL URLWithString:@"http://www.your.site.here/images"];
Then you could do:
NSURL *imageURL = [baseURL URLByAppendingPathComponent:[studentsDict objectForKey:@"imagepath"]];
By the way, you should consider using the UIImageView category, such as SDWebImage . Then, instead of loading NSData with image data synchronously, you can perform asynchronous image loading:
[cell.imageView setImageWithURL:imageURL placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
Placeholder is what should be displayed during image loading (maybe just an empty image), and SDWebImage will asynchronously retrieve the image and update the cell when it is retrieved. This will provide a much more flexible user interface. It will also use image caching (so if you scroll down and then back up, the image will not be restored again).
AFNetworking has a similar UIImageView category, but not an equally reliable implementation. But if you are already using AFNetworking, this is an option.
source share