I tried compiling and running this simple code but it's throwing error
- (void)doSomething
{
UIActionSheet *actionSheet = [[UIActionSheet alloc]
initWithTitle:@"Are you sure?"
delegate:self
cancelButtonTitle:@"No Way"
destructiveButtonTitle:@"Yes, I'm Sure!"
otherButtonTitles:nil];
[actionSheet showInView:self.view];
[actionSheet release];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
// the user clicked one of the OK/Cancel buttons
if (buttonIndex == 0)
{
NSLog(@"ok");
}
}
This is the error thrown:
-[__NSCFData actionSheet:clickedButtonAtIndex:]: unrecognized selector sent to instance 0x6d6df80
2010-10-25 16:07:36.120 iota[31172:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFData actionSheet:clickedButtonAtIndex:]: unrecognized selector sent to instance 0x6d6df80'
The interesting thing is that it is not running as part of a bigger code but runs fine on a standalone basis.