Skip to content

Instantly share code, notes, and snippets.

@nsillik
Created July 14, 2014 06:18
Show Gist options
  • Save nsillik/38c10d7c0443df8887f9 to your computer and use it in GitHub Desktop.
Save nsillik/38c10d7c0443df8887f9 to your computer and use it in GitHub Desktop.
ughhhhhh
class ManagedObjectContext : NSManagedObjectContext {
func insert<T : NovelTManagedObject where T: EntityNamable>() -> T {
let entityName = T.entityName()
var managedObject = T(entity: NSEntityDescription.entityForName(entityName, inManagedObjectContext: self), insertIntoManagedObjectContext: self)
return managedObject as T
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment