0

Day, guys. I need to set append new object to Array, which placed in Parse.com. Something like this:

    var myArray:NSArray = []
    myArray.append("newObject")
    PFObject.setObject(myArray, forKey: "ArrayParse")

My goal - is saved Username to Array and get them, from array in parse. Thanks a lot for helping

1 Answer 1

1

I think that you can use a fonction like this :

func saveUsernameToParse(){
    var usernames = ["Jon", "Joe", "Jim"]
    var parseClass = PFObject(className: "_User")

    for username in usernames {
        parseClass["username"] = username
        parseClass.saveInBackgroundWithBlock{(success: Bool, error: NSError!) -> Void in
            if success == false {
                println(error)
            } else {
                println("Posted succesfully")
            }
        }
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.