我已经将Rebekka触摸框架添加到我的Swift 3项目中,以便通过FTP上传文件。Swift 3 - FTP上传
我已经使用Xcode中迅速3转换工具,我只剩下一个错误
型“NSMutableData”的价值没有成员“计数”
这里的地方它发生:
let bytes = self.inputData!.bytes.bindMemory(to: UInt8.self, capacity: self.inputData!.count)
全功能:
override func streamEventEnd(_ aStream: Stream) -> (Bool, NSError?) {
var offset = 0
let bytes = self.inputData!.bytes.bindMemory(to: UInt8.self, capacity: self.inputData!.count)
let totalBytes = CFIndex(self.inputData!.length)
var parsedBytes = CFIndex(0)
let entity = UnsafeMutablePointer<Unmanaged<CFDictionary>?>.allocate(capacity: 1)
var resources = [ResourceItem]()
repeat {
parsedBytes = CFFTPCreateParsedResourceListing(nil, bytes.advancedBy(offset), totalBytes - offset, entity)
if parsedBytes > 0 {
let value = entity.pointee?.takeUnretainedValue()
if let fptResource = value {
resources.append(self.mapFTPResources(fptResource))
}
offset += parsedBytes
}
} while parsedBytes > 0
self.resources = resources
entity.deinitialize()
return (true, nil)
}
有没有人知道self.inputData!.count
的swift 3等价物?
怎么样'self.inputData。长度' –
尝试使用'.length'属性'数据' –
我正在尝试,现在我会更新问题,如果它工作 –