Вы говорите, что хотите сравнить даты последнего изменения, чтобы увидеть, совпадают ли они?
Я думаю, что лучший способ сделать это - сохранить дату (в виде строки) в Список объектов .Если вы создаете приложение для iPhone, вы можете создать список свойств со строкой с кодом ниже.Этот код проверяет, существует ли файл, и если он существует, он читает из него, а если нет, создает его и записывает в него.
// Get the path to the property list.
NSArray *pathArray = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *pathToPlist = [[pathArray objectAtIndex:0] stringByAppendingPathComponent:@"yourfilename.plist"];
// Check whether there is a plist file that already exists.
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:pathToPlist];
if (!fileExists) {
// There is no file so we set the file up and save it.
NSMutableDictionary *newDict = [NSMutableDictionary dictionaryWithCapacity:1];
[newDict setObject:yourStringWithTheLastModifiedDate forKey:@"lastModified"];
[newDict writeToFile:pathToPlist atomically:YES];
}
} else {
// There is already a plist file. You could add code here to write to the file rather than read from it.
// Check the value of lastModified.
NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithContentsOfFile:pathToPlist];
NSString *lastModifiedDate = [persistentNonResidentData objectForKey:@"lastModified"];
// Add your own code to compare the strings.
}
Или, возможно, я неправильно понял ваш вопрос иэто может быть совсем не то, что вы ищете lol.