我想開始學習使用NSAsynchronousFetchRequest,參考
I even try to execute some simple project from https://github.com/abhishekbedi1432/Core-Data-Asynchronous-Fetching/tree/master which is using NSAsynchronousFetchRequest.
If I do not enable -com.apple.CoreData.ConcurrencyDebug 1, the sample project from github able to perform asynchronous fetch without issue. However, once the -com.apple.CoreData.ConcurrencyDebug 1 is enabled, it will also be getting the same fatal error.
uj5u.com熱心網友回復:
您必須為當前的 Core Data 容器創建一個新的背景關系,無論是子項還是根父項,如下所示:
let backgroundContext = persistentContainer.newBackgroundContext()
backgroundContext.parent = persistentContainer.viewContext
使用多個背景關系的詳盡解釋在這里。
uj5u.com熱心網友回復:
對我來說,異步獲取請求在我為其提供estimatedResultCount值時按預期作業。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/401740.html
