[英]Fetch from core data and display it in tableview in swift 5
As per your comments on Ashish's response, it seems like you are not saving the managed object context after inserting the records.根据您对 Ashish 回复的评论,您似乎在插入记录后没有保存托管 object 上下文。
Insertion process:插入过程:
Then notify the view controller to refresh the weather list using NSNotification on the main thread or some other mechanism as per your suitability.然后通知视图 controller 使用主线程上的 NSNotification 或其他机制根据您的适用性刷新天气列表。
And then try to fetch weathers from viewContext for UI rendering.然后尝试从 viewContext 中获取天气以进行 UI 渲染。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.