Not sure what happened, I must have corrupted the database somehow. I just created a new project (same name, different directory), created the core data model again (you can just copy and paste entities from old version to new one, but make sure you reconnect the relationships). THEN generate the nsmanagedobject classes.
Then I copied all the other files, classes, etc... It worked fine after that.