I implemented a navigation controller in my iPad app which works perfectly fine.
Now, on one view of the navigation stack I want to pass data to the parent view if popped to it.
I tried this in the child view controller:
(property of dataArray +synthesize in both views)
-(void)viewWillDisappear:(BOOL)animated
{
if([self isMovingToParentViewController])
{
int currentVCIndex = [self.navigationController.viewControllers indexOfObject:self.navigationController.topViewController];
ParentViewController *parent = (ParentViewController *)[self.navigationController.viewControllers objectAtIndex:currentVCIndex];
parent.dataArray = self.dataArray;
}
}
Any Ideas why not working?