How can I passing data from parent view controller to child view controller?
I tried doing this with delegates. but I don't think it's an option?
How can I passing data from parent view controller to child view controller?
I tried doing this with delegates. but I don't think it's an option?
You can access your child view controllers by:
Option 1
If you're passing from a parent to a child view controller, then just set the property of your childViewController from the parent.
Option 2
Or, you can set up a delegate
Step 1: set up protocol above interface in ChildViewController.h file
Step 2: create delegate property in ChildViewController.h interface
Step 3: declare delegate protocol in ParentViewController.h
Step 4: in ParentViewController.m add this method:
Step 5: before launching childViewController declare delegate property.
Step 6: in child view controller whenever you want data add this
The parentVC will run 'giveMeData' and return a NSMutableDictionary (adjust for whatever data you want)