简体   繁体   English

Parse&Swift-没有与查询匹配的结果

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

I seem to have a different problem than the previous askers. 我似乎有一个与以前的问题不同的问题。

I am trying to retrieve my object from Parse in Swift, I use this code 我试图从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)
  }
}

Ignore the fact that I left GameScore the same... 忽略我离开GameScore一样的事实......

Anyway's here is an image of my Parse data, to proof the objectId exists. 无论如何这里是我的Parse数据的图像,以证明objectId存在。

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

This is the error I get in the console when running the simulator. 这是我在运行模拟器时在控制台中遇到的错误。

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})

Why am I getting an error "No results matched the query" when the objectId does indeed exist? 当objectId确实存在时,为什么我收到错误“没有结果与查询匹配”?

You have to make sure that the "className" property on PFQuery matches a class name that you have stored in Parse. 您必须确保PFQuery上的“className”属性与您在Parse中存储的类名匹配。 In your case, it seems that it should be var query = PFQuery(className: "Content") based on the picture that you uploaded. 在您的情况下,它似乎应该是基于您上传的图片的var query = PFQuery(className: "Content")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM