App Crashes When User Starts Typing in Uisearchbar

Typing in UISearchBar crashes my app

After burning an entire day struggling with this, it came down to a totally unrelated problem: a corrupted storyboard.

This SO question recommended finding which scene was corrupt and recreating it. Unfortunately there was no way for me to determine that, so after some trial and error, it ended up being the initial view controller in my storyboard, which happened to be a UINavigationController. I deleted that, added it back in, and everything is golden.

Custom UITableViewCell causing UISearchBar to crash

I came across the same problem as yours too not too long ago. What I did to make mine work was instead of laying out my custom cell directly in the prototype cell, I created a separate .xib file for it, set the prototype cells in my tableViewController to 0 and did

let regularCell = UINib(nibName: "Cell", bundle: nil)

self.searchDisplayController!.searchResultsTableView.registerNib(regularCell, forCellReuseIdentifier: "Cell")


Related Topics



Leave a reply



Submit