ios - Core Data: Database not reading correctly -
i'm trying load nsdata core data database data isn't remotely close what's displaying if compare 2 files, original database vs 1 saved nsdata loaded, , 1 saved nsdata doesn't have data in @ all, table structure.
here's source, , it's extremely basic:
nsmanagedobjectcontext *managedobjectcontext = self.managedobjectcontext; if (managedobjectcontext != nil) { nserror *error = nil; if ([managedobjectcontext haschanges] && ![managedobjectcontext save:&error]) { // replace implementation code handle error appropriately. // abort() causes application generate crash log , terminate. should not use function in shipping application, although may useful during development. nslog(@"unresolved error %@, %@", error, [error userinfo]); abort(); } } nsstring *path = [appdelegate instance].databasedirectory.path; nsdata *file = [[nsfilemanager defaultmanager] contentsatpath:path]; [file writetofile:[appdelegate instance].tempdatabasedirectory.path atomically:no];
Comments
Post a Comment