AlertView issue

After AlertView closed, application freezes.

Anybody knows the solution?

I did this:

    UIAlertView alertView =
            UIAlertView.alloc().init();
    alertView.setMessage("Cannot Show Rss news: " + errorMessage + " Try again?");
    alertView.setDelegate(new UIAlertViewDelegate() {
        @Override
        public void alertViewClickedButtonAtIndex(UIAlertView alertView, @NInt long buttonIndex) {
            if (buttonIndex == 0) {
                // try
                refreshControll.beginRefreshing();
                loadURL(url, true);
                alertView.dismissWithClickedButtonIndexAnimated(buttonIndex, true);
            } else {
                //cancel
                alertView.dismissWithClickedButtonIndexAnimated(buttonIndex, true);
            }
        }
    });
    alertView.addButtonWithTitle("Try");
    alertView.addButtonWithTitle("Cancel");
    alertView.show();

Dear Máté Illés,

in Apple’s documentation:

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;

Discussion

The receiver is automatically dismissed after this method is invoked.

I think you simply don’t need to call alertView.dismissWithClickedButtonIndexAnimated(...) manually.