I'm trying to delete a saved Object in Parse and Replace it. My code is not working. My Parse Database is only adding objects with the same array name. Here is my code.......

```
 @IBAction func finalSaveBTN(sender: AnyObject)
    {
        videoARY = [videoId, vidTitleText, vidDescription, vidIMG]
        let videoSave = PFObject(className: "UserVideos")
        videoSave.deleteInBackgroundWithBlock { (success, error) -> Void in
            if success == true
            {
                videoSave["userObjectId"] = PFUser.currentUser()!.objectId
                videoSave["vid\(self.saveValueLBL.text!)"] = self.videoARY
                videoSave.saveInBackgroundWithBlock { (success, error ) -> Void in
                    if success == true
                    {
                        print("Succesfull")
                    }
                }
            }
            else
            {
                print("Error")
            }
        }
    }

```

I would like to delete the object, but if anyone knows how to successfully update a Parse array that'll help too. Thank you.

\*\*\* UPDATE \*\*\*\*

I'm trying this, not working either, what could be wrong....

```
@IBAction func finalSaveBTN(sender: AnyObject)
    {
        videoARY = [videoId, vidTitleText, vidDescription, vidIMG]
        let videoSave = PFObject(className: "UserVideos")
        let query = PFQuery(className: "UserVideos")
        query.whereKey("userObjectId", equalTo: PFUser.currentUser()!.objectId!)
        query.findObjectsInBackgroundWithBlock {
            (objects: [AnyObject]?, error: NSError?) -> Void in
            for object in objects!
            {
                let vid = object["vid\(self.saveValueLBL.text!)"]!
                vid!.delete()
            }

        }
        videoSave["userObjectId"] = PFUser.currentUser()!.objectId
        videoSave["vid\(self.saveValueLBL.text!)"] = self.videoARY
        videoSave.saveInBackgroundWithBlock { (success, error ) -> Void in
            if success == true
            {
                print("Succesful")
            }
        }
    }

```

\*\*\*\* UPDATE \*\*\*\*\*
I'm deleting all vids for videoSave. If you have any suggestions on how to target specific array I'll appreciate it. I'll try to rework and save as simply PFFile

```
@IBAction func finalSaveBTN(sender: AnyObject)
    {

            videoARY = [videoId, vidTitleText, vidDescription, vidIMG]
            let videoSave = PFObject(className: "UserVideos")
            let query = PFQuery(className: "UserVideos")
            query.whereKey("userObjectId", equalTo: PFUser.currentUser()!.objectId!)
            query.findObjectsInBackgroundWithBlock {
                (objects: [AnyObject]?, error: NSError?) -> Void in
                for object in objects!
                {
                    if let vid = object["vid\(self.saveValueLBL.text!)"]!
                    {
                    vid.deleteInBackground()
                    vid.saveInBackground()
                    }
                }

            }
            videoSave["userObjectId"] = PFUser.currentUser()!.objectId
            videoSave["vid\(self.saveValueLBL.text!)"] = self.videoARY
            videoSave.saveInBackgroundWithBlock { (success, error ) -> Void in
                if success == true
                {
                    print("Succesful")
                }
            }

```