首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >tableView:didSelectRowAtIndexPath失败

tableView:didSelectRowAtIndexPath失败
EN

Stack Overflow用户
提问于 2016-11-11 07:25:34
回答 1查看 105关注 0票数 0

我的tableView:didSelectRowAtIndexPath实现不起作用。

另一方面,swipe的实现也是如此。

单击表行时,我希望显示另一页。

这是我的密码:

代码语言:javascript
复制
func tableView(_ tableView: UITableView, didSelectRowAtIndexPath indexPath: IndexPath) {


    let  tableCell: SearchTableViewCell = tableView.dequeueReusableCell(withIdentifier: "searchcell") as! SearchTableViewCell


    if(self.searchstatus == "people")
    {
        if(useridarray.object(at: (indexPath as NSIndexPath).row) as! NSString != "null" )
        {

            self.searchdelegate.otheruserid=useridarray.object(at: (indexPath as NSIndexPath).row) as! NSString;
            let ProfilePageViewController = self.storyboard?.instantiateViewController(withIdentifier: "otherprofile")
            self.present(ProfilePageViewController!, animated: false, completion: nil)
        }
    }
    else
    {
        if(useridarray.object(at: (indexPath as NSIndexPath).row) as! NSString != "null")
        {
            let hashtag1=search.text!.replacingOccurrences(of: "#", with: "")
            self.searchdelegate.hashtag="\(hashtag1)" as NSString!
            self.searchdelegate.hashtag=searchdelegate.hashtag.trimmingCharacters(in: CharacterSet.whitespaces) as NSString!
            self.searchdelegate.hashtag=searchdelegate.hashtag.replacingPercentEscapes(using: String.Encoding.utf8.rawValue) as NSString!
            let hashtag = self.storyboard?.instantiateViewController(withIdentifier: "hashtag")
            self.present(hashtag!, animated: false, completion: nil)
        }

    }

}

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-11-11 07:28:12

使用这种方法,它是的3.0

代码语言:javascript
复制
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
 }
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40543100

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档