I am using Realm to handle persisting data to disk in my app.
我正在使用Realm在我的应用程序中处理持久化数据到磁盘。
To return my objects saved in Realm, I use RLMResults
which successfully returns objects saved in my database
要返回我在Realm中保存的对象,我使用RLMResults成功返回保存在我的数据库中的对象
RLMResults <Cat *> *cats = [Cat allObjectsInRealm:myRealm];
The problem is I have no way of knowing when this operation is completed. I need my network request to wait on the completion of this query before proceeding. The realm documentation is not very thorough and I can't see a way for me to know when this read operation is complete.
问题是我无法知道此操作何时完成。在继续之前,我需要我的网络请求等待完成此查询。领域文档不是很彻底,我无法看到一种方法让我知道这个读操作何时完成。
Is there some sort of completion block available?
是否有某种完井模块可供使用?
1 个解决方案
#1
2
Realm's query APIs are synchronous, and the results they return are available to calling code immediately.
Realm的查询API是同步的,它们返回的结果可用于立即调用代码。
#1
2
Realm's query APIs are synchronous, and the results they return are available to calling code immediately.
Realm的查询API是同步的,它们返回的结果可用于立即调用代码。