안녕하세요. 간단한 UIView가 있는데, 그 안에 UIButton이 있고, 메소드를 호출하고 있습니다. 최대한 단순화하려고 노력했지만 지속적으로 같은 오류 :인식 할 수없는 셀렉터가 인스턴스로 전송 됨 - UIButton 액션
2011-02-25 10:33:23.423 USOpenTimeLine[21288:207] -[CALayer buttonClicked:]: unrecognized selector sent to instance 0x4d2a020 2011-02-25 10:33:23.425 USOpenTimeLine[21288:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayer buttonClicked:]: unrecognized selector sent to instance 0x4d2a020' * Call stack at first throw:
내 코드는 다음과 같다 :
-(UIView *)createView:(NSArray *)_data{
UIView *_view = [[UIView alloc ] initWithFrame:CGRectMake(0, 0, 1024, 768)];
pageData = [[NSMutableArray alloc] init];
self.imageData = _data;
[_view setBackgroundColor:[UIColor colorWithRed:1.0 green:1.0 blue:0 alpha:1.0]];
[self addSubview:_view];
UIButton *_button1= [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
_button1.frame = CGRectMake(110.0, 360.0, 100.0, 30.0);
[_button1 setTitle:@"Play" forState:UIControlStateNormal];
_button1.backgroundColor = [UIColor clearColor];
[_button1 addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
[_view addSubview:_button1];
[_button1 release];
[_view release];
return _view;
}
- (IBAction)buttonClicked:(id)sender
{
NSLog(@"Hi!");
}
나는 내 인생에 여기 무슨 일이 일어나고 있는지 알아낼 수 없습니다 ... 어떤 도움이나 통찰력이 크게 될 것 고맙다! 감사합니다.
좋아요, 알아 냈습니다. 부모보기를 너무 일찍 릴리스했습니다. – FlashGuy13