iphone - Pre-filling .sqlite file to add to iOS app, then nothing in .sqlite file but the schema (no data) -


I want to fill in a core data database for use in my iOS app. I am full of databases and I have shown in my app I can see the data I have seen. When I can not fill AppDelegate.m in the database, I do not get anything when I ask the database, when I fill it, then I get the data that I want. So I think there is data in the database. I think that my iPhone Simulator-> MyApp-> is a full .sqlite file in the document. I drag it to my desktop, and I'm using Firefox's skylit viewer tool so that I can check the data in SSKlight file. When I do this, I do not see any lines of data except the schema, metadata, and primary key.

When I use the Firefox viewer to look for other .sqlite files, I see actual data, but this is one I do not see it.

Am I removing data before viewing it in Firefox Tools?

I am adding data like this:

  NSMOSubClass * tempItem = [NSEntityDescription insertNewObjectForEntityForName: @ Managed object contexts in "EntityName": context]; TempItem.type = typeF; TempItem.internalValue = @ (dataUnit.value); TempItem.name = @ (dataUnit.name); [Self-save reference: context];  

I am saving the context like this:

  - (BOOL) saveContext: (NSManagedObjectContext *) Reference {NSError * error; If (! [Avoid context: & amp; error]) {NSLOG (@ "could not save:% @", [error localized description]); no return; } Yes return; }  

I ask for data like this:

  AppDelegate * appDel = [[UIApplication shared application] representative]; NSManagedObjectContext * Reference = [Apdel Managed ObjectCorrect]; NSError * error; NSFetchRequest * fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription * entity = [NSEntityDescription EntityForName: @ Managed object contexts in "EntityName": context]; [FetchRequest Set Entity: Entity]; NSArray * fetchedObjects = [reference executeFetchRequest: fetchRequest error: & amp; Error];  
  • I did not make any changes made by Xcode when you started an app with the coredata.
  • The context was not being saved. I have added the following change:

      If there is an option to (<_ _ _ _ _ _ _ _ _) "" "" ""  @ {NSSQLitePragmasOption: @ {@ " Journal_mode ": @" DELETE "}}  instead of  zero . 

    > if (! [_stistentStoreCoordinator AddPersistentStoreWithType: NSSQLiteStoreType Configuration: Zero URL: storeURL Option: @ {NSSQLitePragmasOption: @ {@ "journal_mode": @ "DELETE"}} Error: & amp; Error] )

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -