uibutton没有工作uitableview

时间:2015-12-29 17:25:14

标签: ios objective-c swift uitableview uibutton

我选择了单元格但代码不起作用时,我已按程序设置了按钮标题

这是代码

    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

         if indexPath.row == 0
            {
                btnLocation.setTitle("Your Location", forState: UIControlState.Normal)
            }
            else
            {
                btnLocation.setTitle(locArr[indexPath.row - 1], forState: UIControlState.Normal)
            }
    //location = locArr[indexPath.row]
    print(locArr[indexPath.row])
    table1.deselectRowAtIndexPath(indexPath, animated: true)
    table1.hidden = true

    flag = 0

}

我不知道如何解决它!!!!!

由于

0 个答案:

没有答案