, , , , , , .
:
((pController *)self.parentViewController).testString;
, UIViewController, , UITabBarController, selectedViewController .
modal.h
id delegate;
@property (nonatomic, assign) id delegate;
alloc/init modalViewController,
modalViewController.delegate = self;
That way I could call self.delegate from my modal. This was not enough, since it does not say which view controller it is, so I can’t say
self.delegate.testString;
But the casting, which I learned earlier, allowed me to get a fully working solution
((pController *)self.delegate).testString;
Hopefully I didn’t just blabber along this path, and I hope that this can help someone in the future.
source
share