开发者

UIButton addTarget:action:ForControlEvents not working

i am getting a view out of a nib like so:

NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"PostitView" owner:self options:nil];
viewPostit = [nib objectAtIndex:0];

then I add the following to it:

[viewPostit.btnAction addT开发者_如何学Pythonarget:self action:@selector(btnSavePostitClicked:) forControlEvents:UIControlEventTouchUpInside];

The view and all the other controls I add custom properties to works perfectly. But when I click that button, no event gets triggered and I dont know why.

Any suggestions what I am doing wrong?

-(void) btnSavePostitClicked:(id)sender
{}

Thank you

Tom


Have you linked btnAction in IB ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜