Most likely you set the alert view's delegate
to self
(the view controller). So if the view controller is dismissed before the alert view, the alert view tries to contact its (now reallocated) delegate.
Simply pass nil
to the alert view delegate
instead of self
. This assumes you don't actually need to handle the OK button.