So, most of the questions are "my tableView only shows the first row, what's wrong?". Well, what I need is exactly the opposite.
I have a SearchBar
(not Search Display Controller
) and until the user starts typing, I want to show ONLY the first row and nothing more.
My TableView
's content is Dynamic Prototypes
, with 2 Prototype Cells
.
The first is the only one I want to show, but it shows others in blank.
https://www.dropbox.com/s/q4ak6z3gbc0gh5c/Screenshot%202014-07-22%2011.24.22.png
This is my tableView:numberOfRowsInSection:
.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSInteger numberOfRows = 0;
if ([self.searchBar.text isEqualToString:@""]) {
numberOfRows = 1;
}
return numberOfRows;
}
All the help will be very appreciated! \o/