parse.com中的子类化转换错误

时间:2015-03-16 10:27:00

标签: ios xcode swift parse-platform

我在尝试将PFQuery的结果转换为正确的子类时遇到错误。

错误为swift_dynamicCastClassUnconditional

我的代码看起来像这样:

let resellerQuery = Reseller.query()    // Reseller is a subclass of PFObject

resellerQuery.fromLocalDatastore()

resellerQuery.whereKey("name", equalTo: resellerName)

resellerQuery.getFirstObjectInBackgroundWithBlock({ (result: PFObject?, error) -> Void in

   if (error == nil) {
      let resellerObject = result as Reseller
   }
})

我在创建resellerObject的行上收到错误。

let resellerObject = result as Reseller

你有什么想法吗?

0 个答案:

没有答案