Save data but crashed at try super.save() #91
Comments
Hello. Do you have a description of the |
Hi @gizcloud did you find solution? I'm also getting this error 👍 |
Without a description of the |
I mean I need to know what is the result of the |
There where no error log. Just crash with pointer. |
I had a similar bug.
|
Same issue with me the print never executes |
Update: |
I have the same issue which is resolved when I use static DataContext |
Well... Usually only one main thread context is used by an app. Other background contexts can be used as well (temporary or not). Anyway, can you test if this issue occurs using the version from |
Hello, I'm having the same error. I have tested using the version from develop branch as well. I am saving JSON data (multiple entities) concurrently and the app crash in
inside DataContext.swift. |
I had that problem too and ended up using a static instance: extension DataContext {
class var sharedInstance: DataContext {
struct Static {
static let instance: DataContext = DataContext()
}
return Static.instance
}
} I've also moved the saving to a single place, since I use the ACD for a cache only and don't care much about validity of the stored data: func applicationDidEnterBackground(application: UIApplication) {
do {
try DataContext.sharedInstance.save()
print("applicationDidEnterBackground data saved")
} catch {
print("applicationDidEnterBackground:\(error)")
}
} |
When I try to save data with Swift2.0. The program broke down at , When I ran again, the data has been saved into the database when fetch them. how to solve that?
My Code is:
The text was updated successfully, but these errors were encountered: