简体   繁体   中英

searching in large amount of info in a single file on iphone

I wanna store a list of people while each person has some pieces of info associated with him. for example location and phone number and e-mail address.

i wanna store in this list around 10,000 persons. After that i want to search this list dynamically (after typing each letter , the database is searched for new matches to the string written in the search box)

[if there is a scientific name for this search process , let me know it please :) ]

My Question is What do you think i should use in my implementation for best performance?

SQLite, XML, plist ???

and is there any tutorial about this kind of search ?

Thanks in advance

You should definitely be using SQLite for this, and using the CoreData abstraction layer would probably be a good ideas as well unless you are already a pro at SQLite calls. The documentation for Core Data would be a good place to start on how to do this. Apple provides several examples that are similar to what you are doing.

You should use a database for this. Searching in a database is a lot quicker than searching in a file. Not quite sure how much memory it would take but it might even be possible to load it all in memory if it is just a list of names. That is how it would be done on a desktop application for sure, but might not work on an iPhone which has a lot less memory.

SQLite for the win!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM