Last active
January 4, 2018 04:11
-
-
Save jwhitehorn/933ff45e74adcecc7b7a2c9c1b12d360 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
| NSString *documentsDirectoryPath = [documentPaths objectAtIndex:0]; | |
| NSString *checksum = nil; | |
| BOOL initialSync = YES; | |
| if([this isUpdatePending]){ | |
| NSString *filePath = [documentsDirectoryPath stringByAppendingPathComponent:@"updated.db"]; | |
| NSData *contents = [NSData dataWithContentsOfFile:filePath]; | |
| checksum = [contents MD5HexDigest]; | |
| initialSync = NO; | |
| }else if([this hasPerformedInitialSync]){ | |
| NSString *filePath = [documentsDirectoryPath stringByAppendingPathComponent:@"database.db"]; | |
| NSData *contents = [NSData dataWithContentsOfFile:filePath]; | |
| checksum = [contents MD5HexDigest]; | |
| initialSync = NO; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment