How to take copy of FMResultset in FMDB Sqlite

人走茶凉 提交于 2019-12-11 18:18:14

问题


I tried to return the reference of FMResult object from a method and trying to access values from the returned object and couldn't able to access.

So can anyone suggest how to return the FMResult object from method and access it from outside.

Thanks in advance.....


回答1:


You can use a reference to a FMResultSet elsewhere, however it must be used on the same thread where the original query was ran.

Also, you can only iterate over the result set once. After you iterate, it will automatically close the sqlite statement and you will no longer be able to access the results.

If that doesn't give you any clues, post all the relevant code.




回答2:


FMResultSet objects are pretty transient. The come and go very quickly. If you need to preserve information from a result set for any sort of extended period of time (like, longer than your current method), then you should extract the values you care about and save them yourself.



来源:https://stackoverflow.com/questions/6417340/how-to-take-copy-of-fmresultset-in-fmdb-sqlite

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!