Swift println()在编写代码时未显示自动完成选项 [英] Swift println() not showing autocomplete options while writing code

查看:89
本文介绍了Swift println()在编写代码时未显示自动完成选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用println()功能进行打印时,没有迅速显示自动完成参数列表.我的Xcode有什么问题吗?

When I am trying to print using println() function it is not showing autocomplete parameter list in swift. Is there any problem in my Xcode?

推荐答案

我找到了造成这种情况的原因.... 如Dhruv所述,它仅接受字符串参数.因此,我们需要将对象转换为内联println()函数.

Hi I found the reason for this.... As Dhruv mentioned, it only accepts string argument. So we need to convert object to string inline println() function.

例如:

我们将整数定义为 var age:Int = 24

we have integer defined as var age:Int = 24

然后我们可以将其打印为

then we can print this as

println("\(age)")

在这种情况下,我们将获得自动完成选项. 另一方面, println(age)将打印与上面相同的结果.

In this case we will get autocomplete option. On other hand println(age) will print same result as above.

这篇关于Swift println()在编写代码时未显示自动完成选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆