Core Data: What difference between insertNewObject vs designated initializer
<p>I have found two solutions to the problem:</p>

<pre><code>public class MyClass: NSManagedObject {
    init(_ entity:NSEntityDescription, dict: NSDictionary, context: NSManagedObjectContext) {
        super.init(entity: entity , insertInto: context)
    }
}

let entity = NSEntityDescription.entity(forEntityName: "MyClass", in: self.context!)
_ = MyClass.init(entity!, dict: item as! NSDictionary, context: self.context!)
</code></pre>

<p>and </p>

<pre><code>let myClass = NSEntityDescription.insertNewObject(forEntityName: "MyClass", into: context) as! MyClass
</code></pre>

<p>but I cannot understand the difference in the end. And how does it affect <code>NSManagedObjectContext</code>?</p>