UItextViewがスライドしているときにメソッドを呼び出し、そのタグを判別したいと思います。私はこのコードを使用していました:
-(IBAction)donecomment:(id)sender{
UISwipeGestureRecognizer *myLongPressRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(holdpress:)];
[textname addGestureRecognizer:myLongPressRecognizer];
textname.editable = NO;
textname.userInteractionEnabled = YES;
CGRect frame = textname.frame;
frame.size.height = textname.contentSize.height;
textname.frame = frame;
heightInteger = heightInteger + textname.contentSize.height + 6;
[textnameArray addObject:textname];
addComment.hidden = NO;
doneComment.hidden = YES;
cancelComment.hidden = YES;
}
-(void)holdpress:(id)sender{
UITextView *txtChoosen = (UITextView*) sender;
for (UITextView* txt in textnameArray) {
if (txt.tag == txtChoosen.tag) {
txt.layer.borderWidth = 5.0f;
txt.layer.borderColor = [[UIColor whiteColor] CGColor];
}else{
txt.layer.borderWidth = 0.0f;
txt.layer.borderColor = [[UIColor whiteColor] CGColor];
}}
...このエラーが発生します:理由:'-[PhotoViewController holdpress]:認識されないセレクターがインスタンス0x22c1a000に送信されました'
私はそれを使用してそれを解決できると思います:
- (void)rightSwipeHandle:(UISwipeGestureRecognizer*)gestureRecognizer
...しかし、htisを使用することは、送信者を削除することを意味します。私に何ができる?