簡體   English   中英

Parse&Swift-沒有與查詢匹配的結果

[英]Parse & Swift- No results matched the query

我似乎有一個與以前的問題不同的問題。

我試圖從Swift中的Parse中檢索我的對象,我使用此代碼

    var query = PFQuery(className:"GameScore")
query.getObjectInBackgroundWithId("mlwVJLH7pa") {
  (gameScore: PFObject?, error: NSError?) -> Void in
  if error == nil && gameScore != nil {
    println(gameScore)
  } else {
    println(error)
  }
}

忽略我離開GameScore一樣的事實......

無論如何這里是我的Parse數據的圖像,以證明objectId存在。

http://i.stack.imgur.com/XeFHH.jpg

這是我在運行模擬器時在控制台中遇到的錯誤。

2015-07-21 11:10:39.496 ParseStarterProject[959:19643] [Error]: No results matched the query. (Code: 101, Version: 1.7.5)
Optional(Error Domain=Parse Code=101 "No results matched the query." UserInfo=0x7fdeaadb1200 {error=No results matched the query., NSLocalizedDescription=No results matched the query., code=101})

當objectId確實存在時,為什么我收到錯誤“沒有結果與查詢匹配”?

您必須確保PFQuery上的“className”屬性與您在Parse中存儲的類名匹配。 在您的情況下,它似乎應該是基於您上傳的圖片的var query = PFQuery(className: "Content")

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM