2016-08-09 54 views
1

我在我的應用程序導入圖像後,得到了在Xcode的調試區以下消息:我得到Metadata.framework錯誤,當我嘗試導入圖像

"[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 
     } 
} 

回答

1

我收到此錯誤消息,因爲我有Spotlight索引禁用(所以應用和圖像的元數據不可訪問)。

轉向聚焦自動索引上的錯誤信息

"Metadata.framework [Error]: couldn't get the client port" 
在Xcode的調試區

消失後。

相關問題