Open olivierto opened 11 years ago
iOS 5 or 6? Showing alert in main thread?
it's on iOS6 the alert appears from main thread (do i need to try in a secondary thread?) the async action comes from a secondary thread
It's fine.
Set a break point after dismissal, use po [view recursiveDescription]
to print out your view hierarchy. Try to find out if there is any view block the tap event.
after dismissal ? you mean in the didDismiss handler ?
I debugged the view hierarchy but it gives me nothing... (i placed a break point in the teardown method).
The alert view is showing in a custom vc. A push notification comes up. Here is my piece of code which is launched when it receives a push notification.
AlerteViewController *alVC=[[AlerteViewController alloc] init];
UINavigationController *navVC= [[UINavigationController alloc] initWithNavigationBarClass:[CustomNavigationBar class] toolbarClass:nil];
navVC.viewControllers = @[alVC];
id rvc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
[rvc presentViewController:navVC animated:YES completion:nil];
the view controller is appearing behind the alertview. And after, when i dismiss the alert the UI doesn't respond anymore :'(
I'm stucked ... thanks for your help
ok here is a screen shot from spark inspector showing the view hierarchy after dismissal it looks like the window and background are still there after dismiss :octocat:
Can you send your example code to me? I will take a look about that. kevincao[at]sumi-sumi.com
sure i will make a dummy project with the same conditions to reproduce and i will send it to you as soon as possible.
I meet the same issue on iOS7. After dismiss alert, my button on my view can't be touched, it seems tap is blocked by alert view, even it should be dismissed. The same code works fine in iOS6.
It was the UIWindow that caused the problem, indeed. I could fix it by adding a call to [window autorelease] just after it was created. I will submit a patch with the correction.
It seems the problem of the UIWindow not being correctly released was caused by me not compiling in ARC mode. Using ARC mode fixes this problem, and a few other crashes.
Me too ! same problem T T
Has anybody been able to solve this? I've got the same problem as @realsnake, ios7 freezes up after dismiss (and I open up a new UIAlertView in the completion handler block). I've confirmed that it's being compiled with ARC.
^ not sure of the scientific reasons why this works, but it fixed the problem for me.
I am having this issue as well in iOS 7. I see a fix was merged back in October, but still having problems with UI interactions failing after dismissal. Here is my usage, as you can see, very simple. UI is non-interactable after 'cancel' button is tapped and alert dismisses:
SIAlertView *alertView = [[SIAlertView alloc] initWithTitle:@"Purchase Product" andMessage:@"You need to purchase this product.\n Would you like to visit the store now?"];
[alertView addButtonWithTitle:@"View Store"
type:SIAlertViewButtonTypeDefault
handler:^(SIAlertView *alert) {
[self performSegueWithIdentifier:@"displayStore" sender:self];
}];
[alertView addButtonWithTitle:@"Cancel"
type:SIAlertViewButtonTypeCancel
handler:^(SIAlertView *alert) {
}];
alertView.transitionStyle = SIAlertViewTransitionStyleBounce;
[alertView show];
I have the same problem on iOS 7 as @jhickman7. Although in my case the UI is blanked once a button is pressed. I messed around a bit as I was calling SIAlertView in the delete of an actionsheet. So I did this: [self performSelector:@selector(showSIAlertView) withObject:nil afterDelay:1.0f];
And it now works. Note that a delay of 0.2 did NOT work.
This is because of the oldKeyWindow (and similarly oldTintAdjustment). They will race when two alerts show up and other dismisses before other. (The other will have the other alerts keyWindow and tintAdjustment). So tint adjustments may appear wrong similarly as the UI may lock up. You should not rely on keeping the state yourself like this.
if ([SIAlertView sharedQueue].count == 1) { [SIAlertView hideBackgroundAnimated:YES]; }
改成
if ([SIAlertView sharedQueue].count >= 1) { [SIAlertView hideBackgroundAnimated:YES]; }
就OK了。
Hello ! SIAlertview works like charm but here is a tricky situation that always freezes my interface.
I got an alert showing (a SIAlertView latest release).
An async event (eg. push notif) comes out. This event is likely to show a modal view controller. Everythings works fine, the alert is still in foreground and the modal view controller is background.
BUT when i click to dismiss the alert, the interface of my view controller behind do not respond anymore.
I think this bug is generated by the window it creates... but not sure...