For one thing, you should autorelease your alertView. -alertView:didDismissWithButtonIndex:
is called by the UIAlertView
, so the alertView object should still be valid (not -release'd
) when your method returns.
Better yet, convert to ARC and be done with manual -retain
, -release
and -autorelease
;)
If you're not converting to ARC, do this: remove the -release from the code in your original post, uncomment the //CRASH
in your -alertView:didDismissWithButtonIndex:
method and change the -release
to -autorelease
there.