UIAlertView Delegates

后端 未结 4 1178
南旧
南旧 2020-12-30 02:17

Can someone explain how the delegate to a UIAlertView works? Is it automatically called or do I have to call it? Eg:

- (void)alertView:(UIAlertVie

4条回答
  •  清酒与你
    2020-12-30 02:43

    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/ios/#documentation/UIKit/Reference/UIAlertViewDelegate_Protocol/UIAlertViewDelegate/UIAlertViewDelegate.html to see it in action.

提交回复
热议问题