Here is idea to check with HTTP response
NSURLRequest *request;
NSURLResponse *response = nil;
NSError **error=nil;
NSData *data=[[NSData alloc] initWithData:[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:error]];
NSString* retVal = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
// you can use retVal , ignore if you don't need.
NSInteger httpStatus = [((NSHTTPURLResponse *)response) statusCode];
NSLog(@"responsecode:%d", httpStatus);
// there will be various HTTP response code (status)
// you might concern with 404
if(httpStatus == 404)
{
// do your job
}
or
while(httpStatus == 200){
static int increment = 0;
increment++;
// check other URL yoururl/somthing/increment++
}
but it will be slow. what my suggestion is, if you are using your own webserver, then, you can send all the image information initially. I'm sure you are doing this job on annonymous or other website :)
Let me know if it helps you or not
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…