我有这个代码.对WebView的引用是我放在页面上的WebView元素.
我有这个代码:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor colorWithWhite:0.859 alpha:1.000];
theWebView.delegate = self;
}
Run Code Online (Sandbox Code Playgroud)
我在这条线上收到警告:
self.view.backgroundColor = [UIColor colorWithWhite:0.859 alpha:1.000];
Run Code Online (Sandbox Code Playgroud)
他说:
Assigning to 'id<UIWebViewDelegate>' from incompatible type 'BalanceSheetController *const_strong'
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么会发生这种警告?如果没有该行,则无法识别UIWebView上的链接.
谢谢!
您的View控制器很可能不实现UIWebViewDelegate协议.即使它有方法,你可能也没有在你的接口声明中.它应该看起来像:
@interface YourViewController : UIViewController <UIWebViewDelegate>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1238 次 |
| 最近记录: |