i hope you can help!
I have a class called Exercise:
import Foundation
import CoreData
class Exercise: NSManagedObject
{
@NSManaged var name: String
}
and created an Entity called Exercise with an attribute "name" of type String.
Now i want to access it from a ViewController:
var context = (UIApplication.sharedApplication().delegate as AppDelegate).managedObjectContext!
var exercise: NSManagedObject = NSEntityDescription.insertNewObjectForEntityForName("Exercise", inManagedObjectContext: context) as Exercise
But if i now try and run it, the codes stops in Thread1 at swift_dynamicCastClassUnconditional with "Swift dynamic cast failed"
I tried this on another project and it worked, I can't find the mistake!
Thanks in advance!