Append url to image path NSString?
<p>I'm developing an iOS application consisting of a static sqlite database, series of tableviews and tab based detail view where the first view loaded in the detailview is a swipable imageView which loads a series of images.</p>

<p>I've got it working with this code where it looks for the image locally but I'd like to have it load the image from a URL or display a default image if no internet connection is available.</p>

<p>The images are named in the database as (for the example) image.jpg and I'd like all of them to load from the same URL directory (for the example) <a href="http://www.someurl.com/images/" rel="nofollow">http://www.someurl.com/images/</a></p>

<p>Thank you</p>

<pre><code>- (UIImage *) imageAtIndex:(NSUInteger)index {

Image  *currentImage = (Image *) [self.images objectAtIndex:index];

NSString *path = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",[[currentImage filename] stringByDeletingPathExtension]] ofType:@"jpg"];

return [UIImage imageWithContentsOfFile:path];
}
</code></pre>
