Ios 如果可以远程使用较新版本,则更新本地捆绑包文件
在应用程序包中,我有一个PDF文件,用作“用户指南”或手册Ios 如果可以远程使用较新版本,则更新本地捆绑包文件,ios,objective-c,load,bundle,Ios,Objective C,Load,Bundle,在应用程序包中,我有一个PDF文件,用作“用户指南”或手册 -(void)loadManual { UIWebView *webPDF = [[UIWebView alloc] initWithFrame:self.view.frame]; webPDF.delegate = self; webPDF.backgroundColor = [UIColor blackColor]; webPDF.opaque = YES; [self.view addSub
-(void)loadManual
{
UIWebView *webPDF = [[UIWebView alloc] initWithFrame:self.view.frame];
webPDF.delegate = self;
webPDF.backgroundColor = [UIColor blackColor];
webPDF.opaque = YES;
[self.view addSubview:webPDF];
webPDF.center = self.view.center;
webPDF.tag = 88;
NSString *thePath = [[NSBundle mainBundle] pathForResource:@"manual" ofType:@"pdf"];
if (thePath) {
NSData *pdfData = [NSData dataWithContentsOfFile:thePath];
[webPDF loadData:pdfData MIMEType:@"application/pdf"
textEncodingName:@"utf-8" baseURL:nil];
}
}
问题:如何优雅地检查我的服务器是否有更新版本的“manual.pdf”,如果服务器上有更新版本,请下载并替换本地文件您可以计算该文件的md5(查看此项了解iOS详细信息)在两侧,如果结果不同,则从服务器下载新版本。为此,您可以将文件下载到Documents文件夹或类似文件夹,我建议您将其标记为不包含在iTunes备份中,这将为您节省修订过程的时间请详细说明与此问题相关的修订过程,谢谢。苹果建议不要在iTunes备份中包含可以重新创建的资源,请解释如何从备份中排除文件