Swift println() not showing autocomplete options while writing code

若如初见. 提交于 2019-12-09 19:06:42

问题


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?


回答1:


Delete user/Library/Developer/Xcode/DeriveData and delete the data of folder(Derive data) and restart Xcode. Should work. If doesn't, restart mac after doing this.




回答2:


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.

For example:

we have integer defined as var age:Int = 24

then we can print this as

println("\(age)")

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




回答3:


As was said earlier, do this:

Delete user/Library/Developer/Xcode/DeriveData and delete the data of folder(Derive data) and restart Xcode. Should work. If doesn't, restart mac after doing this.

But after you did it, make sure you did context-click on Xcode -> Quit, and the same for Simulator. And then if doesn't work, you don't need to restart your mac. Write "Int." or some other system type, but not yours that you have issue with and voila!



来源:https://stackoverflow.com/questions/28429630/swift-println-not-showing-autocomplete-options-while-writing-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!