I want to using core data to save and load my data that I get from server:
private lazy var managedObjectModel : NSManagedObjectModel = {
let modelURL = NSBundle.mainBundle().URLForResource(self.manageObjectModelName, withExtension:"mom")!
return NSManagedObjectModel(contentsOfURL: modelURL)!
}()
I have an error
unexpectedly found nil
while unwrapping an Optional value in this code. And my persistanceStoreCooardinator storage and mainQueueContext storage are nil.
How can solve this problem?
Typo in this line mom instead of momd:
let modelURL = NSBundle.mainBundle().URLForResource(self.manageObjectModelName, withExtension:"momd")!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With