UITableViewCell swipeGesture麻烦

时间:2014-11-24 20:41:27

标签: ios objective-c uitableview

我在viewDidLoad中有以下代码:

UITableView *tableView = (id)[self.view viewWithTag:1];
forCellReuseIdentifier:usersTableIdentifier];
tableView.separatorColor = [UIColor clearColor];
tableView.backgroundColor = [UIColor orangeColor];
[tableView setBounces:NO];
UINib *nib = [UINib nibWithNibName:@"userCell" bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:usersTableIdentifier];

UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc]   
initWithTarget:self action:@selector(handleSwipeLeft:)];
[recognizer setDirection:UISwipeGestureRecognizerDirectionLeft];
[tableView addGestureRecognizer:recognizer];

[UITableView handleSwipeLeft]unrecognised selector sent to instance.

我已在头文件中包含了手势擦除的代理人。我尝试使用self / tableView作为initWithTarget的参数: 我在教程中看到过这段代码。任何人都可以告诉我我需要做些什么才能让它发挥作用?

0 个答案:

没有答案