My real problem is i want to pass data from childViewController to parentViewController in storyboard by modal segue.
Code
parentViewController.h
@property (strong, nonatomic)NSMutableArray *address;
childViewController.m
parentViewController *parent=(parentViewController *)self.presentingViewController;
post.address=@"Hello World";
This code throw exception like
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MainTabbarViewController setAddress:]: unrecognized selector sent to instance 0x7fa070e6b910'
storyboard structure
TabbarController-> NavigationController-> parentViewController-> childViewController
Thank you in Advance.
There is no way to get a reference to the segue that created you. You could create a property (sourceVC in my example) in the destination controller, and assign self to this property in the prepareForSegue method (in the source view controller):
[(ChildViewController *)segue.destinationViewController sourceVC] = self;
Anyway, I think it's a better solution to use a delegate.
* In ChildViewController.h *
* In ParentViewController.h *
* In ParentViewController.m *
* In ChildViewController.m *