I have a problem with this code:
Header:
@interface ViewController : UIViewController {
IBOutlet UITextField *field;
IBOutlet UIWebView <UIWebViewDelegate> *web;
}
Implementation:
@protocol UIWebViewDelegate;
- (void)viewDidLoad{
//some other code here
webView = [[UIWebView alloc] init];
webView.delegate = self;
}
I got two problems. The first is that on the line webView = [[UIWebView alloc] init];‘Passing ViewController*const_strong to parameter of incompatible type ‘id’`.</code>the compiler generates the following message:Incompatible pointer types assigning to 'UIWebView*_strong' from 'UIWebView'*'.
The second problem is that I get an error on the line <code>webView.delegate = self;</code> that says:
Any ideas? Any help will be welcome.
You’ve declared your
webViewivar to be aUIWebViewDelegate. You meant to makeViewControlleraUIWebViewDelegate: