I have a for-loop that currently loops 4 times.
//Add all the URLs from the server to the array
for (int i = 1; i <= 5; i++){
NSString *tempString = [[NSString alloc] initWithFormat : @"http://photostiubhart.comoj.com/GalleryImages/%dstiubhart1.jpg", i];
[myURLS addObject: [NSURL URLWithString:tempString]];
[tempString release];
}
As you can see the URL has a digit in it that get incremented by 1 each loop to create a new URL where the next image will be. However, the amount of images on the server won't necessarily be 4, it could be a lot more or even less. My problem is this, is there a way I can check if there is an image stored at the URL? And if there is not, break the loop and continue program execution?
Thanks,
Jack
See Question&Answers more detail:os