Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 带有webview参数的xcode选择器_Iphone_Objective C_Ios_Xcode_Uiwebview - Fatal编程技术网

Iphone 带有webview参数的xcode选择器

Iphone 带有webview参数的xcode选择器,iphone,objective-c,ios,xcode,uiwebview,Iphone,Objective C,Ios,Xcode,Uiwebview,我正在尝试使用执行选择器的NSTimer。在这个选择器上,我需要传递一个webview参数。我试着像以前那样处理字符串,但不起作用。如何到达它?多谢各位 -(void)setVars:(UIWebView *)webView{ ... } -(void)webViewDidFinishLoad:(UIWebView *)webView { [NSTimer scheduledTimerWithTimeInterval:.60 target:self selecto

我正在尝试使用执行选择器的NSTimer。在这个选择器上,我需要传递一个webview参数。我试着像以前那样处理字符串,但不起作用。如何到达它?多谢各位

-(void)setVars:(UIWebView *)webView{

   ...
}


-(void)webViewDidFinishLoad:(UIWebView *)webView {


        [NSTimer scheduledTimerWithTimeInterval:.60 target:self selector:@selector(setVars:) withObject:webView userInfo:nil repeats:NO];

为什么不使用性能选择器:with对象:afterDelay如下:

[self performSelector:@selector(setVars:) withObject:webView afterDelay:1];

为什么不直接使用
performSelector:withObject:afterDelay:
,在您的情况下:
[self-performSelector:@selector(setVars:)withObject:webView afterDelay:60]