Coredata Appdelegate - ERROR

Asked

Viewed 28 times

0

I am encountering error when creating the context variable "There was an error Creating or loading the application’s saved data." The error returned is in the persistentStoreCoordinator of Appdelegate.Swift

@IBAction func salvarButton(sender: UIButton) {
    let appDel: AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate 
    let context: NSManagedObjectContext = appDel.managedObjectContext


let newUser = NSEntityDescription.insertNewObjectForEntityForName("Pessoa", inManagedObjectContext: context)
newUser.setValue(nomeText.text, forKey: "nome")
newUser.setValue(Int(idadeText.text!), forKey: "idade")

1 answer

0


The problem appeared after I modified the database.. The problem was solved by restarting the Simulator, in the Simulator menu -> Reset Content and Settings

Browser other questions tagged

You are not signed in. Login or sign up in order to post.