I have sorted the original array in popover controller. Now I want to send that array back to the original view controller for tableview and map view.
Below is my code
If propertyNameSrt == false
{
if ascSorting == false
{
properties.sort(sorterForbuildingAsc)
}
else
{
properties.sort(sorterForbuildingDesc)
}
}
My array is properties which includes custom object. How can pass this to my original view controller? Thanks in advance, Dhaval.
You can use delegate(protocol) methods to send back data to previous view controller.
IN CURRENT VC:
Make a var in your class.
Now call the protocol method when you pop the view controller, with your "properties" array as parameter.
IN PREVIOUS VC:
In your previous VC, set the mDelegate property to self, when you push the current VC.
Now implement the protocol method in your previous VC.