当我尝试将具有多个参数的方法添加到按钮的选择器时,由于未捕获的异常“NSInvalidArgumentException”而出现此错误正在终止应用程序
[viewButton addTarget:self action:@selector(loadDocument:inView:) withObject:cerereIndemnizatie.fisier withObject:self.myWebview forControlEvents:UIControlEventTouchUpInside];
这是方法
-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
{
NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:@"pdf"];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
}