I have a UIWebView on my main window. Can I control that via my second view controller? If so could you give me an example?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can. The “how” is a basic Cocoa / application architecture subject you can learn from the introductory documentation from Apple or any number of other web sites.
The gist is that you need to have a reference to the web view’s controller (or the web view itself) from the second controller. This could be an outlet or a regular instance variable in the second controller. Then it’s a matter of calling
[firstController makeTheWebViewDoSomething];.See also Communicating with Objects.