在我的应用程序中导入图像后,我在Xcode的调试区域中收到以下消息:
"[21950:1148196] Metadata.framework [Error]: couldn't get the client port".
如何摆脱这个错误?
这是我上传图片的代码:
@IBAction func importButton(sender: AnyObject) {
let uploadFile: NSOpenPanel = NSOpenPanel()
uploadFile.allowsMultipleSelection = false
uploadFile.canChooseFiles = true
uploadFile.canChooseDirectories = false
uploadFile.runModal()
let chosenPicture = uploadFile.URL
if(chosenPicture != nil) {
let pictureImport = NSImage(contentsOfURL: chosenPicture!)
imageWell.image = pictureImport
}
}
我收到此错误消息是因为我禁用了Spotlight索引编制(因此无法访问应用程序和图像的元数据)。
开启Spotlight自动索引功能后,出现错误消息
"Metadata.framework [Error]: couldn't get the client port"
在Xcode的调试区域中消失了。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句