最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

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

Swift crifan 1604浏览 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
91 queries in 0.195 seconds, using 22.03MB memory