I’m trying to push a view controller like so:
SampleViewControllerB *svcb = [self.storyboard instantiateViewControllerWithIdentifier:@"viewB"];
svcb.delegate = self;
[self.navigationController pushViewController:svcb animated:YES];
If I remove the svcb.delegate = self; line, it compiles fine and works properly. However, if I try to add it in, it won’t compile and gives the error
Property 'delegate' not found on object of type 'SampleViewControllerB *'
Does anybody know how to fix this? Thanks in advance!
This is your problem. You have to define your own
delegateproperty in your class, and make calls to it yourself. Make sure to remember to make a delegate protocol too!