#在蓝懿学习iOS的日子#day18
1建立一个WebView
首先要搭建
然后编写代码 @property (weak, nonatomic) IBOutlet UIWebView *myWV;
@property (weak, nonatomic) IBOutlet UITextField *myTF;
@end
@implementation ViewController
- (IBAction)clicked:(id)sender {
NSURL *url = [NSURL URLWithString:self.myTF.text];
//创建请求
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[self.myWV loadRequest:request];
@property (weak, nonatomic) IBOutlet UITextField *myTF;
@end
@implementation ViewController
- (IBAction)clicked:(id)sender {
NSURL *url = [NSURL URLWithString:self.myTF.text];
//创建请求
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[self.myWV loadRequest:request];
}