最新消息:20190529 VPS服务器已从腾讯云香港换为Vultr新加坡,主题仍用朋友推荐的大前端D8

【已解决】swift 3出错: ‘init()’ is deprecated: init() will be removed in Swift 3. Use `nil` instead

Swift crifan 556浏览 0评论

代码:

let contextHolder = UnsafeMutablePointer<Void>()

出错:

 ‘init()’ is deprecated: init() will be removed in Swift 3. Use `nil` instead

搜:

 ‘init()’ is deprecated: init() will be removed in Swift 3. Use `nil` instead

ios – How to fix warning init() is deprecated – Stack Overflow

Xcode 7.3 beta 2 & 3 issue · Issue #212 · xmartlabs/Eureka

Swift 3: Parameterless initializer will be removed warning (Swift) – Codedump.io

audiokit/AudioKit – Travis CI

改为:

//        let contextHolder = UnsafeMutablePointer<Void>()
        let contextHolder:UnsafeMutablePointer<Void> = nil

或:

let contextHolder = UnsafeMutablePointer<Void>(nil)

即可。

转载请注明:在路上 » 【已解决】swift 3出错: ‘init()’ is deprecated: init() will be removed in Swift 3. Use `nil` instead

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
66 queries in 0.093 seconds, using 18.56MB memory