如何使用 UIButton addTarget 将 NSString 对象作为参数传递给另一个方法:
这是我的代码:
- (void)vision:(PBJVision *)vision capturedVideo:(NSDictionary *)videoDict error:(NSError *)error
{
_recording = NO;
if (error) {
NSLog(@"encounted an error in video capture (%@)", error);
return;
}
_currentVideo = videoDict;
NSString *videoPath = [_currentVideo objectForKey:PBJVisionVideoPathKey];
NSLog(@"string = %@",videoPath);
UIButton *ok = [UIButton buttonWithType:UIButtonTypeRoundedRect];
ok.frame = CGRectMake(95, 3, 50, 30);
[ok setTitle:@"OK" forState:UIControlStateNormal];
[ok addTarget:self action:@selector(okwindow:) forControlEvents:UIControlEventTouchUpInside];
[customview addSubview:ok];
}
如何将字符串值作为参数传递给 addTarget:
请提供任何建议以及解决方案...