UISearchBar Bookmarks

Does anyone have a good example of bookmark storage for a UISearchBar? What's the most elegant way to keep this? Any code sample would be appreciated.

+2


source to share


1 answer


Use NSMutableArray. Whenever the user searches for something, it adds a string object to the array. If you want to show a list of bookmarks, you have a table view below the search bar with a list of keywords. If any bookmarks match the keyword, make the table view visible otherwise hidden. If you want to save bookmarks locally so that they are saved when you launch applications, you can use [array writeToFile: @ "filename"]; and you can get [NSMutableArray arrayWithContentsOfFile: "filename"];



0


source







All Articles