Getting data from findObjectsInBackgroundWithBlock in swift

后端 未结 1 1154
误落风尘
误落风尘 2021-01-06 16:15

I am using Parse to get data out of a database. When the block - findObjectsInBackgroundWithBlock is called an array gets passed. As I am only receiving one row of data, it

相关标签:
1条回答
  • 2021-01-06 17:04

    You'll need to cast your [AnyObject] to a [PFObject] and then you can use the standard Parse methods to get the data out.

    if let staffObjects = objects as? [PFObject] {
      for staff in staffObjects {
        // Use staff as a standard PFObject now. e.g.
        let firstName = staff.objectForKey("first_name")
      }
    }
    
    0 讨论(0)
提交回复
热议问题