Objective c 在记录点击量后,如何删除或停止表视图中的按钮

Objective c 在记录点击量后,如何删除或停止表视图中的按钮,objective-c,ios,uitableview,Objective C,Ios,Uitableview,我在表视图中有一个添加行的按钮。最多五行之后,我想停止用户添加更多内容。目前,我显示一个警报后,按钮收到5点击 我如何阻止用户使用按钮超过此点?设置为hidden不会作为自定义子类工作,并且在类上找不到属性hidden - (void)viewDidLoad { [super viewDidLoad]; UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; titleLabel.backgroundColor =

我在表视图中有一个添加行的按钮。最多五行之后,我想停止用户添加更多内容。目前,我显示一个警报后,按钮收到5点击

我如何阻止用户使用按钮超过此点?设置为hidden不会作为自定义子类工作,并且在类上找不到
属性hidden

- (void)viewDidLoad
{

[super viewDidLoad];

UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.textColor = [UIColor whiteColor];
titleLabel.shadowColor = [UIColor darkGrayColor];
titleLabel.text = self.distributionBoard.dbRef;
titleLabel.font = [UIFont boldSystemFontOfSize:15.0f];
[titleLabel sizeToFit];
self.navigationItem.titleView = titleLabel;

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneButtonPressed:)];

// Add new appliance button to the table view's footer view
UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(10.0f, 0, 300.0f, 100.0f)];  
footerView.backgroundColor = [UIColor clearColor];
UIButton *newBoardButton = [UIButton buttonWithType:UIButtonTypeContactAdd];
CGRect buttonFrame = newBoardButton.frame;
buttonFrame.origin.x = footerView.frame.size.width - buttonFrame.size.width;
newBoardButton.frame = buttonFrame;
[newBoardButton addTarget:self action:@selector(addCircuitButtonPressed:)    forControlEvents:UIControlEventTouchUpInside];
[footerView addSubview:newBoardButton];
self.tableView.tableFooterView = footerView;




}


在有AlertView的位置,可以键入此代码以禁用按钮:

[(UIButton *)sender setEnabled:NO];
或隐藏按钮:

 [(UIButton *)sender setHidden:YES];

哪个是自定义子类?新生儿按钮?看起来它是你代码中的UIButton,应该有隐藏属性。是的,这就是我需要做的!我试图隐藏错误的项目。非常感谢,删除了一个括号后,发件人,工作了一个待遇<代码>[(UIButton*)发送方设置隐藏:是]
 [(UIButton *)sender setHidden:YES];