I have 2 classes, MainViewController of kind UIViewController & Foo of kind UIView.
In MainViewController I implemented an UIWebView called myWebView and set it’s delegate to self (MainViewController).
I’m trying to loadRequest this UIWebView from Foo class.
I would like to get some help, I created an instance variable of MainViewController and tried to loadRequest myWebView but with no success.
Thanks,
You need to get the instance of your mainviewcontroller which is already displayed on the screen and then call the request. You should not create a new instance as it would result in a new object.
Try having the references to all your viewcontrollers in the application delegate and pass them around.