With iOS 8, I am having a weird problem with setting up the / UISearchBar table and wondering if others have a similar problem or might indicate that, if you like, I could be wrong. Wide situation:
- I have a UITableViewController with a UISearchBar inside it, configured in a Storyboard application
- The table view has a custom cell configured again in the storyboard
- table row selection causes a spread in another view
- doing a search, clicking a line from the search results to go to another view, and then moving again, causes various problems.
The "problems" are that if I implement cellForRowAtIndexPath as follows:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { MyCell *cell = (MyCell *) [self.tableView dequeueReusableCellWithIdentifier:@"MyId" forIndexPath:indexPath]; ...
in other words, specifying the path to dequeueReusableCellWithIdentifier will result in a BAD_ACCESS error or statement in iOS 8 (but not iOS 7). In particular, either a refusal of approval or BAD_ACCESS occurs when the dequeueReusableCellWithIdentifier is called in the above circumstances, that is, when you actively search, you move from one of the cells in the results table to another view and then leave again.
Now I can stop the error that occurs when calling:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { MyCell *cell = (MyCell *) [self.tableView dequeueReusableCellWithIdentifier:@"MyId"]; ...
without going through indexPath. Then it works without error as such, but when we go to the presentation of the table with the search results, there is a strange display problem in which the layers below the search appear as ghost table separators, almost as if the system is trying to display one table directly on top the other (but cellForRowAtIndexPath is not called for each table, only for the search results table, as expected).
I get the same problem whether segue is related to a cell or table controller (so in the latter case, I implement didSelectRowAtIndexPath to manually run segue).
So: (a) can someone point out what I can do wrong to cause these problems, or (b) point to the open source desktop of the table view controller with UISearchBar, where the table cells go into another view? I am surprised that I am having so many problems, because implementing a searchable table with detailed views should be a normal, boring thing that people do all the time, no?
Sample project showing iusse: http://www.javamex.com/DL/TableTest.zip