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

【已解决】’++’ ‘–‘ is deprecated: it will be removed in Swift 3

Swift crifan 1457浏览 0评论

代码:

        for i in 0..<bufferLen {
            if buffer[i] == CRLFBytes[k] {
                k++
            for var sectionIdx = contactSectionItemList.count – 1; sectionIdx >= 0 ; –sectionIdx {

警告:

‘++’ is deprecated: it will be removed in Swift 3

‘–‘ is deprecated: it will be removed in Swift 3

根据提示去:

改为:

            if buffer[i] == CRLFBytes[k] {
                k += 1
            for var sectionIdx = contactSectionItemList.count 1; sectionIdx >= 0 ; sectionIdx -= 1 {

即可。

对于++放在变量后面的特殊情况,改为:

                //return (String(self.arrayIndex++), JSON(o))
                let curArrIdx = self.arrayIndex
                self.arrayIndex += 1
                return (String(curArrIdx), JSON(o))

即可。

转载请注明:在路上 » 【已解决】’++’ ‘–‘ is deprecated: it will be removed in Swift 3

发表我的评论
取消评论

表情

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

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
85 queries in 0.187 seconds, using 22.06MB memory