UIAlertView Delegates
问题 Can someone explain how the delegate to a UIAlertView works? Is it automatically called or do I have to call it? Eg: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 回答1: So long as you're correctly setting the delegate property of the UIAlertView and implementing the protocol, it will be automatically called when a user clicks on a button in your alert. Take a look at the projects listed under "Related sample code" at http://developer.apple.com/library