plist or sqlite

时光怂恿深爱的人放手 提交于 2019-12-18 04:52:25

问题


I have to store a huge amount of data on IPhone then sort and search it as per requirement. Can anyone suggest to me which of SQLite or plist should I use?

I was thinking of using SQLite. Which of plist and SQLite takes less processing time in searching and sorting?

If some one has some reference guide then let me know.

Regards


回答1:


Plist and SQLite have different use cases.

PList is a file format used to store a small amount of structural data (less than a few hundred kilobytes), typically a dictionary. PList doesn't have sorting capabilities in and of itself, although code can easily be written to sort it.

SQLite is a full-fledged database. File sizes (on an iphone) are essentially unlimited. Sorting capabilities are built in. Querying and relational table designs are possible. Performance should be as good as any sorting algorithm you might come up with.




回答2:


I have not compared the performance of plist vs sqlite, but if you are storing "huge data" as you say then you will benefit from sqlite. Especially if you are going to be performing complex queries, extraction, searching and sorting etc..

From your breif description I would recommend SQLite, but I can't answer your question regarding performance.

Regarding an example on who to use SQLite on the iphone. Apple has a sample on how to do it here



来源:https://stackoverflow.com/questions/1090391/plist-or-sqlite

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