user6032625 user6032625 - 2 years ago 89
Swift Question

How do I gain access to the info inside a PFObject?

I am importing the objects from parse, but I need to gain access to the information inside. The object has the name and the address of a user, and I need to get those. How would I do that?

let query = PFQuery(className: "People")
query.findObjectsInBackgroundWithBlock { (objects: [PFObject]?, error: NSError?) in
if(error == nil){
for object in objects!{




Would I do something like
, I don't think that is the correct syntax for a PFObject.

Answer Source

Just make a loop to access the single object and then fetch value like below:

for Oneobject in objects
   let strAddress = Oneobject["address"] as String
   let strName = Oneobject["name"] as String

Refer the following link:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download