开发者

Search functionality in HTML documents in iPhone

I am working on an iPhone application in whi开发者_C百科ch I have HTML pages created with me.I have a class 'Webpage' in which I just have a UIWebView.At runtime I am creating objects of this class and loading it with HTML content so user can scroll through pages.For memory handling,I am loading only three pages at a time.Now I want to add a search facility to the application.i.e.If the user searches for a word or phrase in the application,the application should show a list of pages containing that word.I can access the names of pages from database but I don't know how can I search through all HTML pages as at a time only some pages are loaded in webviews.Can I search through the HTML pages in my application?If yes then how?Please help me as I have little experience with HTML.


This may sound bit odd but that's what was the most efficient one out of all the available solutions.
I used database to store the contents and title of all the HTML pages and used 'Like' query to search for a word into the database.Also I used highlighting method as mentioned by Naveen Thunga.Thanks Naveen ;)
Combination of these two methods i.e.database and highlighting did the job.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜