奇怪的快速内插错误:找不到成员'convertFromStringInterpolationSegment' [英] Weird swift interpolation error: Could not find member 'convertFromStringInterpolationSegment'
本文介绍了奇怪的快速内插错误:找不到成员'convertFromStringInterpolationSegment'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试在以下代码中使用swift插值时,出现一个奇怪的错误:
I get a weird error when I try to use swift's interpolation in the following code:
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
var alert = UIAlertController(title: "Clicked!",
message:"You clicked row # \(indexPath.row)",
preferredStyle: UIAlertViewStyle.Default);
}
我还没有完成警报视图,但是我不认为这是导致错误的原因.它发生在message参数上.
I haven't finished the alert view yet, but I don't think thats the cause of the error. Its happening at the message parameter.
感谢您的提前帮助!
推荐答案
您在此处选择了错误的enum
值.此代码存在问题:
You chose the wrong enum
value there. Issue is with this code:
UIAlertViewStyle.Default
将其更改为:
UIAlertControllerStyle.Alert
UIAlertViewStyle.Default
用于指定UIAlertview
和UIActionSheet
的按钮样式.
UIAlertViewStyle.Default
is used for specifying the button styles of UIAlertview
and UIActionSheet
.
查看全文