gpt4 book ai didi

ios - 如何在 UITableViewCell 中使用 UIAlertController

转载 作者:行者123 更新时间:2023-11-28 13:07:38 25 4
gpt4 key购买 nike

如何在 TableViewCell 中使用 UIAlertController?

给我一​​个错误does not have a member called "presentViewController"

我的 TableViewController 被命名为“OrdensCompraTableViewController”

我的函数:

@IBAction func telefonarCliente(sender: AnyObject) {

var alert = UIAlertController(title: "Fotos em falta!", message: "Tem de introduzir 6 fotos.", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil))


self.presentViewController(alert, animated: true, completion: nil)

if let phoneCallURL:NSURL = NSURL(string: "tel://") {
let application:UIApplication = UIApplication.sharedApplication()
if (application.canOpenURL(phoneCallURL)) {
application.openURL(phoneCallURL);
}
}
}

最佳答案

使用 telprompt://123456789 而不是创建 UIAlertController 在调用电话号码之前提示用户。

关于ios - 如何在 UITableViewCell 中使用 UIAlertController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32235616/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com