I
I
Ivan2015-12-21 10:49:44
iOS
Ivan, 2015-12-21 10:49:44

How to select values ​​from Data Parse.com in Swift?

Good afternoon! Poke your nose into a normal manual how to pull out the values ​​​​in UIViewTable from Data c Parse.com? all that I found is what a dull g .... under Obective C, but I need under Swift

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2015-12-22
@ivanm38

In the Swift documentation, click. He himself understood it and video from paid resources.
https://www.parse.com/docs/ios/guide
In general, what you are asking is done like this.

var query = PFQuery(className:"GameScore") //"GameScore" - Название твоего класса в Data
query.whereKey("playerName", equalTo:"Sean Plott") //Отбираются строки в которых поля "playerName" имеют значение "Sean Plott"
query.findObjectsInBackgroundWithBlock {
  (objects: [PFObject]?, error: NSError?) -> Void in

  if error == nil {
    // The find succeeded.
    print("Successfully retrieved \(objects!.count) scores.")
    // Do something with the found objects
    if let objects = objects {
      for object in objects {
        print(object.objectId)
      }
    }
  } else {
    // Log details of the failure
    print("Error: \(error!) \(error!.userInfo)")
  }
}

Further in UITableView I think you can throw.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question