具体而言,它将元音符号作为两个字符进行编码。 let unencoded = "könnten"
let encoded = unencoded.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())!
encoded然后等于ko%CC%88nnten。
的this question解决方案不再与斯威夫特3. 作品不再有属性的Databytes(以前NSData。 let data = dataToWrite.first!
self.outputStream.write(&data, maxLength: data.count)
有了这个代码,我得到的错误: Cannot convert value of type 'Data' to exp
我试图删除我的缓存目录中的文件。但是,当我尝试删除单个文件夹时,出现错误提示文件不存在,尽管我知道它确实存在。所以,我尝试使用for循环来删除缓存目录中的所有文件。 do {
for file in try NSFileManager.defaultManager().contentsOfDirectoryAtPath(cacheFolderPath) where !file.hasP