简体   繁体   English

无法将控件从WebView拖动到ViewController.h吗?

[英]Can not control-drag from WebView to ViewController.h?

I want to create a WebView in View Controller. 我想在View Controller中创建一个WebView

I try to control-drag from WebView to ViewController.h , but it is not showing me the blue connector. 我尝试将控件从WebView拖动到ViewController.h ,但没有显示蓝色连接器。

Is there something I am missing? 我有什么想念的吗?

Please help. 请帮忙。 Thank you. 谢谢。

PS I search keyword "web view connect" and "web view" on Apple Documentation, it is showing me WebKit something like that. PS我在Apple文档中搜索了关键字“ Web view connect”和“ Web View”,它向我展示了WebKit类的内容。 What is the keyword should I type? 我应该输入什么关键词?

http://imgur.com/nI7Q3MN http://imgur.com/tzCAaHS http://imgur.com/nI7Q3MN http://imgur.com/tzCAaHS

Make sure of the following things: 请确保以下事项:

1)Make sure that the .h file that you are control + dragging onto is the header file for your view controller. 1)请确保您要控制并拖动到的.h文件是视图控制器的头文件。 You can check this by checking the identity tab for your view controller in the utilities pane and making sure that the class name for the controller matches the header file name that you are control + dragging to. 您可以通过在实用程序窗格中检查视图控制器的标识选项卡,并确保控制器的类名与您要控制并拖动到的头文件名相匹配,来进行检查。

2)Make sure that you are control + dragging in between the @interface and the @end like such: 2)确保您正在控制+在@interface和@end之间拖动,如下所示:

@interface ViewController:UIViewController

// Control + Drag into this area

@end

Have you declared instance variable like IBOutlet _webView; 您是否已声明了IBOutlet _webView;类的实例变量IBOutlet _webView; in your ViewController.h file, if not, Xcode can't show blue connector. ViewController.h文件中,如果没有,则Xcode将不会显示蓝色连接器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM