Câu hỏi phỏng vấn Objective-C
Câu hỏi

What is difference between these three classes [NSManagedObject, NSManagedObjectContext,
NSManagedObjectModel] of CoreData?

Câu trả lời

Here are the key differences between the three Core Data classes you mentioned:

NSManagedObject

  • Represents a single entity instance in the Core Data store
  • Provides methods to access and modify the properties of the entity
  • Automatically handles the creation, updating, and deletion of objects in the context
  • Provides a way to track changes made to the object

NSManagedObjectContext

  • Represents a scratch pad for working with managed objects
  • Acts as the central hub for all interactions with the persistent store coordinator
  • Manages the lifecycle of managed objects, including creating, updating, and deleting them
  • Provides a way to save changes to the persistent store
  • A...
middle

middle

Gợi ý câu hỏi phỏng vấn

junior

What is a protocol, and how do you define your own and when is it used?

expert

What's the difference between marking a method as @objc vs dynamic , when would you do one vs the
other?

junior

What are Objective-C Categories?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào