我在 rightBarBuuttonItem 创建了一个自定义按钮作为 NavigationItem。它工作得很好,但是当我在按钮外部单击时,例如按钮向下一点,它仍然有效。这是我的代码
fetchButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
[fetchButton setImage:[UIImage imageNamed:@"quanse.png"] forState:UIControlStateNormal];
[fetchButton addTarget:self action:@selector(searchDataByColor) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem =[[UIBarButtonItem alloc] initWithCustomView:fetchButton];
谁能告诉我,我能做些什么来修复这个错误?