我是新学习的。
我在UIWebView
上发了Xcode
。
刷新代码模拟器正在运行但无法在手机上运行。 如何运行?
这是代码
-(void)viewDidLoad {
NSString *fullURL = @"http://mysite.com.tr/report";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
webView.delegate = (id)self;
[webView loadRequest:requestObj];
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
[webView.scrollView addSubview:refreshControl];
}
-(void)handleRefresh:(UIRefreshControl *)refresh {
// Reload my data
NSString *fullURL = @"http://mysite.com.tr/report";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[refresh endRefreshing];
[super viewDidLoad];
}