Right now i am using coredata to save my data. Its all working fine but now i changed the logic to save values to the database. So i need to compare that the after logic change same values are getting saved in tables. So I need to compare tables.
I went through many links like link 1 link 2
all the links shows that the database file that coredata create is of .sqlite extension. But the files create at that location are "persistentStore, persistentStore-shm, persistentStore-wal" as show in screenshot.
How should i suppose to open these files to see the saved data in tables. Thanks in advance
- (void)setupDatabase:(void (^)(BOOL))completionHandler
{
NSURL *url = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
url = [url URLByAppendingPathComponent:@"MainDataModel"];
self.db = [[CWUIManagedDocument alloc] initWithFileURL:url];
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
[NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
self.db.persistentStoreOptions = options;
if(![[NSFileManager defaultManager] fileExistsAtPath:[self.db.fileURL path]])
{
[self.db saveToURL:self.db.fileURL forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) {
self.dataManager.db = self.db;
completionHandler(success);
}];
} else if (self.db.documentState == UIDocumentStateClosed) {
[self.db openWithCompletionHandler:^(BOOL success) {
self.dataManager.db = self.db;
completionHandler(success);
}];
}
}