嗨!我正在開發一個應用程序。我正在創建一個webview。通過使用該webview我想在第一個完成後加載下一個url。我寫的- (void)webViewDidFinishLoad:(UIWebView *)webView
這樣在UIWebView中逐個加載多個URL
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
alert_View=[[UIAlertView alloc]initWithTitle:@"\n\nData sent successfully!" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
[alert_View show];
[alert_View release];
[NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(removeAlert:) userInfo:nil repeats:NO];
}
而且removeAlert方法看起來像
-(void)removeAlert:(id)sender
{
[alert_View dismissWithClickedButtonIndex:-1 animated:YES];
[web loadRequest:[arr objectAtIndex:1];
}
arr
數組包含了所有的準備請求。當這個removeAlert
方法直接執行-(void)webView:didFailLoadWithError:
方法被解僱。那麼請告訴我如何在第一個請求結束後加載另一個請求?