ios - Init method for core data entity not available -


I am on xcode 6.1 and developing for iOS 8.1. I have core projects coreattatest where I play with core data.

Model:

  Import Corridata Class License: NSManagedObject {@NSManaged var name: string}  

and

Enter image details here

Now I want to create a license object. What I need to do before creating an item:

  App Deal: AppDelegate = UIApplication.sharedApplication (). Representative reference as AppDelegate: NSManagedObjectContext = appDel.ManagedObjectContext! Let Ent = NSEntityDescription.entityForName ("License", inManagedObjectContext: Reference)  

The problem is that the right constructor does not provide the xcode unit. When I start typing:

var newLicence = License (..

I do not find any autocompletion like this example: / P>

Enter image details here

I'm just as self : Complete NSManagedObject (). Any ideas what is wrong

:)

It is important that the managed object is properly used for the use of core data I have implemented: (

I implemented in my class:

  override init If you are directly an instance of a managed object, then You must call the named operator (unit: NSEntityDescription, insertIntoManagedObjectContext reference: NSManagedObjectContext?) {Super.init (unit: unit, insertIntoManagedObjectContext: reference)}.  

And now it works


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -