This should work.
Here is one of many attempts to get this figured out
myTrainingSessions[indexPath.row].unpinInBackgroundWithBlock{ (suc
One of the reasons this is not working for you is because there might still be objects in your local datastore that have relation with the object you want to unpin. To do this properly, unpin all those objects first and then unpin the target object.