Search code examples
iphoneiosuiactionsheet

UIActionSheet cancel button not dismissing actionsheet


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?


Solution

  • You need to display from a taskbar or a toolbar on iPhone as it clips some of the controls if you use display in view.