【发布时间】:2015-05-15 00:32:45
【问题描述】:
我写了一个应用程序来有一张桌子,当我按下按钮时它会打电话。我已经做了一张表,代码如下..
var callContent = ["Police","Hospital"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return callContent.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
let cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Name")
cell.textLabel?.text = callContent[indexPath.row]
return cell
}
还有我的调用函数
var url:NSURL = NSURL(string: "tel://0812742111")!
UIApplication.sharedApplication().openURL(url)
现在我想从表中执行一个操作来连接我的调用函数。 各位大神可以提个建议吗?
【问题讨论】:
标签: ios uitableview swift call