Search code examples
iosuiactionsheet

UIActionSheet called twice?


My app simply calls one UIActionSheet like this:

UIActionSheet *dataCopySheet = [[UIActionSheet alloc] initWithTitle:@"Copy Element     Information" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Name", @"Melting Point", @"Boiling Point", @"Atomic Mass", @"Density", @"Discovery Info", @"Save Image", nil];
[dataCopySheet showInView:detailView];

For some reason, two UIActionSheets are shown from this (one comes up over the other). Am I doing something wrong?


Solution

  • Ok, figured it out... I called the action sheet from a UILongPressGestureRecognizer, and it was called twice. I changed it to a UITapGestureRecognizer and now it's only called once, works great. Odd issue with UILongPressGestureRecognizer.