我在Dropbox中下载最后一张图片时遇到问题,基本上图像会刷新,直到我将其更改为新图像,如下所示:
运行应用 - >显示最后一张图片 - >在其他设备上更改image1 - >没有变化 - >在其他设备上再次更改图像(2) - >添加图片1 - >在其他设备上再次更改图像(3) - >添加图片2等。
- (void)viewDidLoad
{
[super viewDidLoad];
DBFilesystem* filesystem = [DBFilesystem sharedFilesystem];
PicturePath = [[DBPath root] childPath:@"image.jpeg"];
[filesystem addObserver:self forPathAndChildren:PicturePath block:^{
dispatch_async(dispatch_get_main_queue(), ^{
[self ActualizarFoto];
});
}];
}
-(void)ActualizarFoto{
[DropboxPicture close];
DropboxPicture = [[DBFilesystem sharedFilesystem] openFile:PicturePath error:nil];
NSData *ImagenDropbox = [DropboxPicture readData:nil];
imagenView.image = [UIImage imageWithData:ImagenDropbox];
}
如何下载最新的同步图像Dropbox而不是之前的图像?