iphone: unrecognized selector sent to instance

Posted by eshalev on Stack Overflow See other posts from Stack Overflow or by eshalev
Published on 2010-03-25T11:04:05Z Indexed on 2010/03/25 11:13 UTC
Read the original article Hit count: 269

Filed under:

I am new to objective C, So maybe there is some basic thing that I am missing about selectors. I would like to understand the basic concept behind this error as I have not found an general error reference.

I am getting this error when using:

[CloseButton addTarget:PageContents action:@selector(CloseButtonPressed) forControlEvents:UIControlEventTouchUpInside];

and then later:

- (void)CloseButtonPressed:(id)sender{
   UIAlertView *someError = [[UIAlertView alloc] initWithTitle: @"Comment" message: @"hello" delegate: self cancelButtonTitle: @"Ok" otherButtonTitles: nil];
   [someError show];
   [someError release];
}

© Stack Overflow or respective owner

Related posts about iphone