I have an NSMutableArray
of Person
(NSManagedObject
) which is a property of a UIViewController
PersonsViewController (presented as modal) and is used as a datasource of a UITableView to list all persons.
The array is populated from Core Data. On didSelectRowAtIndexPath
I set selectedPerson
which is a strong, nonatomic property in the presentingViewController.
In PersonsViewController the user can delete items from the UITableView. How do I handle the reference selectedPerson
if the deleted item from the array happens to be the object selectedPerson is pointing to?