Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If - like me - you think the plain TableView was way too ugly, you can also abandon the use of SearchDisplayController.</p> <p>I just:</p> <ul> <li>inserted in an empty View a <strong>searchBar</strong> and a <strong>TableView</strong> as we usually do for IBOutlet</li> <li>selected the <strong>File's owner as delegate for both of them</strong>.</li> <li>At the beginin the number of section is 0 ([myTab count]) then I used reloadData and this time myTab is populated by the result.</li> <li><code>[self.resultTableView reloadData]</code>;</li> </ul> <p>Here you can find all the method I used from the delegates</p> <pre><code>@interface MyViewController : UIViewController &lt;UIApplicationDelegate, UISearchBarDelegate&gt; { IBOutlet UISearchBar *searchBar; IBOutlet UITableView *resultTableView; } @property (nonatomic, retain) IBOutlet UISearchBar *searchBar; @property (nonatomic, retain) IBOutlet UITableView *resultTableView; //For your searchBar the 2 most important methods are - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBarClicked; - (BOOL)searchBarTextDidEndEditing; //For your TableView the most important methods are in my case: //number of sections in the table view. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView; //HEADERS - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section; //different numbers of row by section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; //the cells themselves - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; @end </code></pre> <p>After all, the simplest solution is often the best...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload