Inside the app bundle I have a PDF file which is used as “User guide” or Manual.
-(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];
}
}
Question: How can I elegantly check my server for a newer version of “manual.pdf” and if there is a newer version on the server, download and replace the local file
you can compute the md5 of the file (check this article for iOS details) on both sides and if the results are different download the new version from the server. For doing this you could download the file to the Documents folder or similar, and I recommend you to mark it as not to be included in the iTunes backups, this will save you sometime with the revision process