Xcode 8 不会自动完成 init 方法 [英] Xcode 8 does not auto-complete for init methods

查看:26
本文介绍了Xcode 8 不会自动完成 init 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Swift 3 的 Xcode 8 自动完成常见的初始化方法时遇到问题,我想知道我是否可以做些什么来解决这个问题.

具体来说,采取以下措施:

let jsonString = String(data: jsonData, encoding: .utf8)

初始化方法String(data:, encoding:)不会填充.

EDIT 据 Apple 称,此问题已在 Xcode 10 中修复.

I am having trouble getting Xcode 8 with Swift 3 to auto-complete common initialization methods, and was wondering if there is anything I could do to fix the situation.

Specifically, take something like:

let jsonString = String(data: jsonData, encoding: .utf8)

The initialization method String(data:, encoding:) will not populate.

Demo Video

解决方案

I find it useful to type the actual word .init before asking for code completion. Then later, I take it back out again.

Note that Xcode is very choosy; if you go too far and type .init( it won't work.

EDIT According to Apple, this problem is fixed in Xcode 10.

这篇关于Xcode 8 不会自动完成 init 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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