Skip to content

Instantly share code, notes, and snippets.

@mattneary
Created July 28, 2015 05:18
Show Gist options
  • Save mattneary/ced26bcf2008b8cfc1e6 to your computer and use it in GitHub Desktop.
Save mattneary/ced26bcf2008b8cfc1e6 to your computer and use it in GitHub Desktop.
let testObject = PFObject(className: "User")
testObject["name"] = "Matt"
testObject["location"] = "asdfasdfasdf"
testObject["id"] = "1"
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
println("Object has been saved.")
}
let testObject = PFObject(className: "Event")
testObject["for_user"] = "1"
testObject["event_name"] = "asdf"
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
println("Object has been saved.")
}
let q = PFQuery(className: "User").whereKey("id", equalTo: "1")
let objs = q.findObjects()
objs[0]["name"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment