我想知道如何在 Xcode中使用 aNSString
和 a作为方法参数。UITapGestureRecoginzer
现在我有这个代码:
-(void)setLanguage:(NSString *)language :(UITapGestureRecognizer *)gesture {
gesture.view.alpha = 0.8;
[[NSUserDefaults standardUserDefaults] setValue:language forKey:@"GameLanguage"];
}
这对于UITapGestureRecognizer
:
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(setLanguage:@"en":tap)];
[ENImage addGestureRecognizer:tap];
当我以这种方式尝试时,我只会得到错误。我该如何解决这个问题?