我认为这是可能的,但由于常见的话我无法谷歌是否这是可能的,如果是的话,我做错了什么。我需要在drawRect中的自定义视图按钮,并给它一个选择如何在自定义视图中有一个选择器
// in drawrect
[myButton addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
....
}
-(void)buttonClicked
{
NSLog(@"you clicked the button");
}
响应和运行得到unrecgonized选择错误时:
2013-11-21 20:06:24.847 customui[8529:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[IAMax buttonClicked:]: unrecognized selector sent to instance 0x8ca7d00'
这可能吗?我在做什么? thx提前
啊...... thx(再次)maddy – timpone