본문 바로가기

Programming/Swift

Class: NSManagedObject

A base class that implements the behavior required of a Core Data model object.

 

Declaration

class NSManagedObject : NSObject

Overview

A managed object is associated with an entity description (NSEntityDescription) that provides metadata about the object, including the name of the entity that the object represents and the names of its attributes and relationships. A managed object is also associated with a managed object context that tracks changes to the object graph. 

 

You can’t use instances of direct subclasses of NSObject (or any other class that doesn’t inherit from NSManagedObject) with a managed object context. You may create custom subclasses of NSManagedObject, although this isn’t always required. If no custom logic is needed, you can create a complete Object graph with NSManagedObject instances.

 

If you instantiate a managed object directly, you must call the designated initializer init(entity:insertInto:).

 

developer.apple.com/documentation/coredata/nsmanagedobject

 

Apple Developer Documentation

 

developer.apple.com

 

 

'Programming > Swift' 카테고리의 다른 글

What is Cyclomatic complexity?  (0) 2020.11.25
Closures  (0) 2020.11.11
Class: UserDefaults  (0) 2020.11.10
Class: JSONSerialization  (0) 2020.11.09
Instance Method: dataTask(with:completionHandler:)  (0) 2020.11.08