10
Here is how I show UIAlertView and the delegate clickedButtonAtIndex -
UIAlertView *alert =
[[UIAlertView alloc] initWithTitle: @"title"
message: @"message"
delegate: self
cancelButtonTitle: @"Cancel"
otherButtonTitles: @"Continue", nil];
[alert show];
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
//something
}
This piece of code works perfectly without ARC. But with ARC it throws this error - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType alertView:clickedButtonAtIndex:]: unrecognized selector sent to instance 0x859d790'
Any ideas on why the delegate is throwing this error?