UITableView 显示的是城市的信息
在点击Cell 执行
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
1.方法时创建UIAlertController 对象并添加UIAlertAction
}
这时调用
[self presentViewController:controller animated:YES completion:nil];
可以弹出action sheet.
*******出错处!!!!!
给tableview 加上 UISearchController
搜索成功的数据更新以后再点击cell时,执行
[self presentViewController:controller animated:YES completion:nil];出错原因是: Warning: Attempt to present * on * which is already presenting
解决方法:例如infoArray 是搜索结果保存的数组,在
[infoArray objectAtindex: indexPath.row]; 之前加上上面这句 即可解决。
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self dismissViewControllerAnimated:YES completion:nil]];
[infoArray objectAtindex: indexPath.row]; 之前加上上面这句 即可解决。
}