insert rows in uitableview and update view immediately - iphone

I would like to implement a search facility in my iPhone application. The functionality is similar to iBooks search where the results are updated row by row and become visible. Also one row is used to view the search progress.
Any help is appreciated.

Take a look at UISearchDisplayController. It is used together with a UITableView to provide search. You can probably get started by looking here or just google with your favorite search engine for UISearchDisplayController.

You have to use a background thread to update the table periodically.

Related

How do I combine custom tableView search tools with a UISearchDisplayController?

I have a UITableView with a searchbar. I have a separate page (accessed via a tabBarController) of search tools that can query the data in a number of ways.
The difficulty I'm having is that when I search the data using the custom search tools, I'm filtering the actual tableView, not the UISearchDisplayController's searchResultsTableView.
I would like my custom query tools to effect the searchResultsTableView, but I can not find a way to access it. Also, when I return to the table after using the search tools, the original table is displayed, how can I display the searchResultsTableView?
Any ideas?
Thanks!
How are you populating the searchResultsTableView?
It might be a good idea to keep a separate dataset (maybe an NSArray) for that. When searching begins, matching items would get added to that dataset that, in turn, would be used to populate the searchResultsTableView.
That way, it would be a matter of filtering that specific dataset instead of the original one when using those custom search tools.
As for showing the searchResultsTableView when returning to the view, it depends on what is actually done when moving away from that view. Usual strategies are using setActive:YES on your UISearchDisplayController or storing the search string somewhere and calling setText:SEARCH_STRING on UISearchDisplayController's search bar after returning and retrieving that string.

How to create a combo box for the iPhone without using UIPickerView

I want to create a combo box for an iPhone application like we have on our website. I have searched a lot, but everybody says to use a picker. I want to use the same UI as a web combo box, so is there any way to do that in an iPhone app?
Just create a custom view with button and below that tableview. Set width of tableview similar to the width of button.
On button's event select or un-select tableview. And load the required data in tableview.
Using CALyer and other Core-graphics API, you can customize UI of table view as per your requirement.
Here's an open-source implementation of what you're looking for. That site has a lot of useful, open source controls.
You can use a TableView and expand/collaps the Cells.
Here are some Examples...
Expand collapse UITableViewCell
and here...
http://www.cocoanetics.com/2011/03/expandingcollapsing-tableview-sections/

Two UITableViewControllers and One UISearchDisplay

I'm new to iPhone programming and is faced with a task to show data on of Books where the first table view shows the books in my library using the title of the book to sort and another table view to show the authors. There is a need to have a search bar on both of the table views and when used to search will show results categorized as certain results is returned according to the author and the others returned according to the title. Something similar to the search results returned by the iPod App.
Thanks in advance to all who can shed light.
From what I gather, it sounds like you need to organize this somehow. I recommend you try a tabbed-based application. Create three tabs with the first two having navigation controllers for your tables. The first tab will have the tableView that sorts by book title. The second tab will have the tableView that sorts by the author. The third tab can do the search for either case. Hopefully, that points you in the right direction.

UITableView inside a UITableViewCell? What's the best design?

I've not found a answer to this question anywhere, but this seems like a typical problem: I am dynamically (from a xml file) creating a view to display "Questions" I take from the XML file. I am having problems to display multiple choice questions. I am trying following approach:
Question 1
MultipleChoiceQuestion 2
--First Option
--Second Option
--Third Option
Question 3
Question 4
MultipleChoiceQuestion 5
--First Option
--Second Option
and so on...
So, my Idea is: I have a first UITableView and row for each "normal" question , and a second UITableView for each "Multiple Choice" question that should be loaded into a row from the first UITableView as I showed before.
Is this a good approach or you guys have a better design pattern for this issue?
Thanks a lot!
There is a tutorial for creating custom UITableViewCells with UITableView inside it at:
http://iosstuff.wordpress.com/2011/06/29/adding-a-uitableview-inside-a-uitableviewcell/
iOS SDK is flexible and you can add any UIView subclass element to tableview cells. Have a look at 'Pulse', its a news reader app that won Apple Design Award. This app has horizontally scrollable images and its developers explained that how they used UITableViews to create that. So don't be afraid to implement new ideas no matter how wild they might appear.
Good Luck!
No, no! Please, no! Do not place big UI Elements like table views in a tableviewcell (and surely do not make them scrollable =P).
What about making the user be able to select a question (one question per row) and then show up a picker view with answers, on the place where to keyboard would normally be?
Just like a list of HTML select tags in Mobile Safari.
Or you can use a grouped table view with one group per question, including the chosable answers.

Creating an alternative way to scroll TableView on iPhone

I currently have a TableView with over 35,000 cells. Obviously the standard iPhone flick-and-scroll becomes inefficient with this many cells. I have already implemented search but still think that a way to scroll the entire table is necessary. I am currently using the
-sectionIndexTitlesForTableView:
method to populate the side with the relevant characters, and I want similar functionality to that in Apple's Remote app. I do not have section titles in my table and simply want the sectionIndex to be an alternative way to scroll through the entire 35,000 cell table. How should I go about doing this?
My instinct tells me that a list that large could probably be broken down into smaller sections that could be filtered using the standard hierarchical navigation on the iPhone - that said, without knowing what exactly the data is I can't say that with any confidence.
You say you don't have any section titles - is the list alphanumeric? If so, what is wrong with having a standard alphabetical sectionIndex and sectionTitles?