In ios8 delegate methods of UIActionSheet calling multiple times
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
I have checked in ipad 2 with IOS 8
Its a bug of the ios 8..
As the @rob said UIActionSheet
is deprecated in iOS 8. (UIActionSheetDelegate is also deprecated.)
To create and manage action sheets in iOS 8 and later, use UIAlertController
This is indeed the current behavior that I've seen reported in several places. It does appear to be a bug and hopefully will be fixed soon but no way to know for sure.
You should UIAlertController to replace all AlertView and ActionSheet in iOS8. If your target lower than iOS8, then you should check version and add more code
For example, this code is for iOS8 ActionSheet
-(void)testActionSheet{
UIAlertController* alertAS = [UIAlertController alertControllerWithTitle:@"Test ActionSheet"
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"Action" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
NSLog(@"Action");
}];
[alertAS addAction:defaultAction];
UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
}];
[alertAS addAction:cancleAction];
[self presentViewController:alertAS animated:YES completion:nil];
}
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