我已经尝试了一段时间,但我没有做对.
我在支持文件中编写了以下init函数:
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
webview=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 1024,768)];
}
return self;
}
Run Code Online (Sandbox Code Playgroud)
并在ViewController.m中跟随
- (void)viewDidLoad
{
[super viewDidLoad];
UIWebView *view = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
NSString *url=@"http://www.google.com";
NSURL *nsurl=[NSURL URLWithString:url];
NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];
[view loadRequest:nsrequest];
}
Run Code Online (Sandbox Code Playgroud)
我也尝试在appDelegate的didFinishLaunchingWithOptions:方法中创建webview ,但它也没有用.
什么是正确的方法?
批处理脚本如下:
>>ftp.txt open ftp.site.com
>>ftp.txt username
>>ftp.txt password
>>ftp.txt directoryname
>>ftp.txt quit
ftp -s ftp.txt
Run Code Online (Sandbox Code Playgroud)
如何删除文件夹'directoryname'中的所有文件?