Retrive object but done want to save coredata iOS swift
Problem: I'm having preview option for some data but if i save other data came from server the temp data also saved in my coredata. How to avoid that? Solution: let context = NSManagedObjectContext ( concurr encyType : . privateQueueConcurrencyType ) context. persistentStoreCoordin ator = getContext (). persistentStoreCo ordinator The above code solves my problem. Below are coredata initilisations in my appdelegate. // MARK: - Get the context func getContext () -> NSManagedObjectContext { var context: NSManagedObjectContext ? if #available (iOS 10.0, *) { context = persistentContainer . vie wContext } else { context = managedObjectContext } ...