Is it safe to use the viewContext to save into the persistent store if I have large amounts of data? For example, I have 1000 records on my temporary background context which is a child of the viewContext of the NSPersistentContainer. Once I am done saving all 1000 records in the bg context, I want to save it using the viewContext to persist on the database. Is this the right approach or I should create a background context for saving to the persistent store?
Use NSPersistentContainer viewContext to save to disk?
753 Views Asked by SleepNot At
1
There are 1 best solutions below
Related Questions in CORE-DATA
- Swift code with multiple NSDateFormatter - optimization
- IOS Where To Persist Current User from Back-end
- iCloud Core Data "no document at URL"
- restrict sqlite-wal and sqlite-shm from icloud backup
- Delegate returning nil - Swift
- How to set a core-data attibute to nil, in Swift?
- iOS make task run on background thread Thread safe?
- Calling method on object in NSPredicate with Core Data
- How to get Managed Object context from RestKit 0.20
- Write NSData in NSHomeDirectory
- My app is crashing when I assign the managed object context to a variable
- Fetch unique object based on attribute name from coredata
- NSPredicate filter part of array
- Property 'package_number_7' not found on object of type 'User *' after Lightweight Migration
- Core Data relationship Many-To One
Related Questions in NSPERSISTENTSTORE
- Error while trying to add a NSPersistentStore (SQLite) within a test
- How to recreate persistentStore not to be affected by changing .xcdatamodeld
- how to move UIManagedDocument to iCloud
- Use NSPersistentContainer viewContext to save to disk?
- How to reset CoreData Application
- addPersistentStoreWithType Returns Error 'attempt to insert nil key' for iCloud Storage
- Programmatically Setting Up Core Data - Where Does NSManagedObjectContext Come From?
- Why is NSPersistentStoreCoordinator not recognizing my managed object model?
- Core Data - Migrating to new Model Name
- Objective-C: i can't configure and use a NSPersistentStoreCoordinator
- How to delete data in iCloud
- Use of Persistent Store Co-ordinators?
- How create separate sqlite file with self model
- How to debug/handle intermittent "authorization denied" and "disk i/o" errors when adding SQL store to an NSPersistentStoreCoordinator?
- IOS 10+ Persistence Store Container set parent context to main context
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Generally, I would use a background context for saving large amounts of data and let the main context pick up the changes from the persistent store.
I try use the main context as a read only context as much as possible in apps and use background or child contexts for saving and editing.