I have downloaded a plist file from server, that contains key value pair. Once app resumes/restarts then again I have to download file and check if file has changed.
below is the code to download... I am storing the key values in NSDictionary.
task1 = [session dataTaskWithURL:[NSURL URLWithString:[S3_SERVER_URL stringByAppendingString:propFile]] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
propfilePath = [documentsDirectory stringByAppendingString:propFile];
NSLog(@"DestPath : %@", propfilePath);
[receivedData appendData:data];
NSLog(@"Succeeded! Received %lu bytes of data",(unsigned long)[data length]);
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
[data writeToFile:propfilePath atomically:YES];
if(error == nil){
plistDictionary = [[NSDictionary dictionaryWithContentsOfFile:propfilePath] retain];
[task2 resume];
} else {
}
}];
How can i compare the contents of the two plist files or NS dictionary? Which function is best suited to do the above As I have to do this on app create/resume/restart? It should be compatible to both ios7 and ios8 SDK.