阅读背景:

如何判断我在搜索过程中点击的UITableViewCell?

来源:互联网 

I have a table view set up with a search bar. Everything works great: when I type text into the search bar, the results update in the table view based on my search text. The problem I'm having is in determining what the ID of the table cell is to pass that along when I'm going to my detail view. To clarify: the cells in the table view are usually generated from a SQLite3 database and ordered by their name. So if I have 4 cells: (Cabernet Cortis, Cabernet Franc, Cabernet Sauvignon and Ruby Cabernet), their IDs are normally (78, 79, 80, 378). However when I search "cabernet", and these four items come up, the indexPath.row is (1, 2, 3, 4) instead of (78, 79, 80, 378) so it's taking me to the wrong grape in the detail view (which are the first four grapes in alpha order as entered into my DB).I have a table view set up with a search bar. E




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: