How can I import my data from Parse? I would like to import data from a user class other than the class

Gangyeol Kim

var users = [""] // This is a temporary Array for storing the data from Parse.

@IBOutlet var messageTableView: UITableView!
// The TableView will output the data in the array.

override func viewDidLoad() {
    super.viewDidLoad()

    var query = PFUser.query()

    query!.findObjectsInBackgroundWithBlock({(objects:[AnyObject]?, error:NSError?) -> Void in

        self.users.removeAll(keepCapacity: true)
        //Delete Array Data..
        for object in objects! {

            var posts:PFUser = object as! PFUser

            self.users.append(posts.username!)
            //and append data to Array.

        }

        self.messageTableView.reloadData()}

My question :

This data is loaded from the "Users" class. But what I want is to load the data in the "posts" Class, what do you do? This is my first question raised in Stackoverflow. Please take care of me. : -) Haha

Rob Norback

You're using a PFUser object instead of a PFQuery object.

From the parse documentation (link):

var query = PFQuery(className:"GameScore")
query.whereKey("playerName", equalTo:"Sean Plott")
query.findObjectsInBackgroundWithBlock {
  (objects: [AnyObject]?, error: NSError?) -> Void in

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I import my data from Parse? I would like to import data from a user class other than the class

From Dev

How to use from import if I would like to import the module as a String?

From Dev

Can I import a TypeScript class from my own module to global?

From Dev

How would I import tables into another class (/object??) so I can run queries on it in the other class/object? [slick 3.0][scala]

From Dev

How would I import tables into another class (/object??) so I can run queries on it in the other class/object? [slick 3.0][scala]

From Dev

Parse.com: with parseUser, how can I save data in a column I created in parse from the class?

From Dev

How can I import class from the same package in Java?

From Dev

how can i import class from another module maven

From Dev

how can i import class from another module maven

From Dev

How can I import data from Outlook to Thunderbird?

From Dev

How can I import data from Outlook to Thunderbird?

From Dev

How can I import data from ASCII (ISO/IEC 8859-1) to my Rails/PGSQL database?

From Dev

How can I get data from my import.io api servers

From Dev

How to get my data from website so I can parse it?

From Dev

In Java why would I be unable to import a sub-class into another class when I can import the superclass?

From Dev

How can I import the sample xml data into my Wordpress site?

From Dev

How to import and export data from Matlab to Weka to predict class?

From Dev

How can i collect data from a table column and import that data to a div?

From Dev

How can I import a key from my desktop to the cloudformation template?

From Dev

How can I import an SSH Key from my iPhone to MacOS?

From Dev

How would I create an Array class that can have lower bounds other than zero (in C++)?

From Dev

How can I import XML data into Hadoop

From Dev

How to import class from class included by that class

From Dev

How do I import data in one pillar file from another?

From Dev

How do I import data in one pillar file from another?

From Dev

can I import a function from other user directory while running the main code as super user?

From Dev

Can I construct more than one type of object from same class data with the help of constructor in Java?

From Dev

How can I resolve my class from a different jar with same structure like another

From Dev

How can I import data from a REST call, json feed into a SQLite database on a MAC?

Related Related

  1. 1

    How can I import my data from Parse? I would like to import data from a user class other than the class

  2. 2

    How to use from import if I would like to import the module as a String?

  3. 3

    Can I import a TypeScript class from my own module to global?

  4. 4

    How would I import tables into another class (/object??) so I can run queries on it in the other class/object? [slick 3.0][scala]

  5. 5

    How would I import tables into another class (/object??) so I can run queries on it in the other class/object? [slick 3.0][scala]

  6. 6

    Parse.com: with parseUser, how can I save data in a column I created in parse from the class?

  7. 7

    How can I import class from the same package in Java?

  8. 8

    how can i import class from another module maven

  9. 9

    how can i import class from another module maven

  10. 10

    How can I import data from Outlook to Thunderbird?

  11. 11

    How can I import data from Outlook to Thunderbird?

  12. 12

    How can I import data from ASCII (ISO/IEC 8859-1) to my Rails/PGSQL database?

  13. 13

    How can I get data from my import.io api servers

  14. 14

    How to get my data from website so I can parse it?

  15. 15

    In Java why would I be unable to import a sub-class into another class when I can import the superclass?

  16. 16

    How can I import the sample xml data into my Wordpress site?

  17. 17

    How to import and export data from Matlab to Weka to predict class?

  18. 18

    How can i collect data from a table column and import that data to a div?

  19. 19

    How can I import a key from my desktop to the cloudformation template?

  20. 20

    How can I import an SSH Key from my iPhone to MacOS?

  21. 21

    How would I create an Array class that can have lower bounds other than zero (in C++)?

  22. 22

    How can I import XML data into Hadoop

  23. 23

    How to import class from class included by that class

  24. 24

    How do I import data in one pillar file from another?

  25. 25

    How do I import data in one pillar file from another?

  26. 26

    can I import a function from other user directory while running the main code as super user?

  27. 27

    Can I construct more than one type of object from same class data with the help of constructor in Java?

  28. 28

    How can I resolve my class from a different jar with same structure like another

  29. 29

    How can I import data from a REST call, json feed into a SQLite database on a MAC?

HotTag

Archive