unable to reconnect to sqlite at iOS
===

I have a problem connecting to a sqlite database. I successfully connect but without any special command then I receive the disconnect info ( see end of debug text below )

I am searching since more than a week my fault, but it seems that i have not enough experience to find my error. For info: Prior to the code below I delete the sqlite file and copy a empty one from the bundle dir. And I am using the Master-Detail-Application template from Xcode. Probably I didn't get the right understanding of the PersitantStoreCoordinator Apple using at this example ...

Thanks in advance for any help!


     NSLog(@"NOW ADD PERSITANT STORE AGAIN!");    
    
    if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) 
        
        
        if (error != nil){
            
            NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
        } 
    
    
    
    NSLog(@"Database replacement end!");        

For this code I receive the following debug info:

 NOW ADD PERSITANT STORE AGAIN!

 CoreData: annotation: Connecting to sqlite database file at "/Users/.../Documents/MyDB.sqlite"

 CoreData: sql: pragma cache_size=200

 CoreData: sql: SELECT Z_VERSION, Z_UUID, Z_PLIST FROM Z_METADATA

 Database replacement end!

 CoreData: annotation: Disconnecting from sqlite database.

