Core Data
Core Data stack, NSManagedObject, fetch requests, relationships, migrations, performance
1What is NSPersistentContainer in Core Data?
What is NSPersistentContainer in Core Data?
Antwort
NSPersistentContainer encapsulates the entire Core Data stack including NSPersistentStoreCoordinator, NSManagedObjectContext, and NSPersistentStore. It simplifies initialization by automatically managing configurations and reduces boilerplate code compared to old manual approach. Using NSPersistentContainer is the recommended practice since iOS 10 for quick and thread-safe Core Data setup.
2What is the main role of NSManagedObjectContext?
What is the main role of NSManagedObjectContext?
Antwort
NSManagedObjectContext acts as an in-memory scratch pad between the application and persistent storage layer. It manages CRUD operations, tracks all changes with undo/redo, and coordinates saves to persistent store. A context is bound to a specific queue and must never be shared between threads. Use perform() for any thread-safe interaction.
3What is an NSManagedObject?
What is an NSManagedObject?
Antwort
NSManagedObject is the base class for all persistent objects in Core Data. It represents a unique instance of an entity defined in the data model with a unique objectID. NSManagedObject automatically manages properties via KVC, bidirectional relationships, and object state (inserted, updated, deleted) within the context. Subclassing NSManagedObject allows adding business logic.
How to initialize an NSFetchRequest to retrieve entities?
Which object is responsible for communication with the storage layer?
+19 Interview-Fragen
Weitere iOS-Interviewthemen
Swift Basics
Swift Language Essentials
UIKit Fundamentals
UIViewController Lifecycle
UserDefaults & Keychain
Application Lifecycle
Auto Layout & Constraints
UITableView & UICollectionView
SwiftUI Basics
SwiftUI State Management
SwiftUI Navigation
Networking & URLSession
Codable & JSON Parsing
Protocol Oriented Programming
MVVM Architecture
Push Notifications
Unit Testing & XCTest
UI Testing
Xcode & Build System
Swift Package Manager
Memory Management & ARC
Combine Framework
Concurrency & async/await
iOS Design Patterns
Performance Optimization
Security & Encryption
SwiftUI Advanced
iOS Application Architecture
Meistere iOS für dein nächstes Interview
Zugang zu allen Fragen, Flashcards, technischen Tests, Code-Review-Übungen und Interview-Simulatoren.
Kostenlos starten