I have coreData swift class defined as
import Foundation
import CoreData
@objc(Users)
public class Users: NSManagedObject {
}
Name of file is
Users+CoreDataClass.swift
I need to call this as
NSFetchRequest* request = [Users fetchRequest];
I have tried importing "Users+CoreDataClass-Swift.h"
However its not recognising any class with users name.
What am i missing.
Still inside the Core Data editor, go to the Editor menu and choose Create NSManagedObject Subclass. Make sure your data model is selected then click Next. Make sure the Commit entity is checked then click Next again.
From the Xcode menu bar, choose Editor > Create NSManagedObject Subclass. Select your data model, then the appropriate entity, and choose where to save the files. Xcode places both a class and a properties file into your project.
The Codegen menu is where you specify the code generation for the entity. There are three code generation options. Choosing Manual/None tells Xcode not to generate code for the entity. You must create the class for the entity by creating a new file or by choosing Editor > Create NSManagedObject Subclass.
Use Core Data to save your application's permanent data for offline use, to cache temporary data, and to add undo functionality to your app on a single device. To sync data across multiple devices in a single iCloud account, Core Data automatically mirrors your schema to a CloudKit container.
You can generate Objective-C NSManagedObject
subclasses right away. To do so, change your Models settings accordingly:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With