I am trying to download some images from Dropbox in this way:
-(void)catchTheImage{
NSString *title = [[NSUserDefaults standardUserDefaults]objectForKey:@"Folder3"];
PhotoViewController* sharedSingleton = [PhotoViewController sharedManager];
NSString *filename2 = [NSString stringWithFormat:@"/%@photofile.png.%ld", title, (long)sharedSingleton.tagNumber];
NSString *tmpPngFile = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@", filename2]];
[restClient loadFile:filename2 intoPath:tmpPngFile];
[NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(lf) userInfo:nil repeats:NO];
}
-(void)lf{
NSString *tmpPngFile = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@", filename2]];
UIImage* image = [UIImage imageWithContentsOfFile:tmpPngFile];
photoView.image = image;
}
I know the timer isn’t a good idea but its just for trying.
TagNumber can be 1, 2, or 3 since the images on dropbox are 3, but the images are not showing up. I think they are not saved in the folder at all. May be I have a misunderstanding of how NSTemporaryDirectory works…
Yes, you need to implement Dropbox delegate methods that will return a status about your loading process
here it is
and in your case: