I have an UIActionSheet and I am specifying the cancel button however it does not dismiss when its tapped?
UIActionSheet *actionSheet = [[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Target Complete" otherButtonTitles:nil] autorelease];
[actionSheet showInView:self.view];
According to the documentation I don't need any code and even when I try and implement the didCancel delegate method its never called?
Try this
[actionSheet showInView:[self.view window]];
UIActionSheet cancel button strange behaviour
This Will do the trick
[actionSheet showInView:[self.view window]];
instead of
[actionSheet showInView:self.view];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With