Why do I not need to declare UIAlertViewDelegate in the header?
问题 I thought I had finally managed to understand the concept of a delegate until the following occurred: I changed my header file to remove the reference to the delegate and the Alert still worked. The only difference is that I lose code hinting. //.h #import <UIKit/UIKit.h> //@interface ViewController : UIViewController <UIAlertViewDelegate> @interface ViewController : UIViewController - (IBAction)showMessage:(id)sender; @end //.m #import "ViewController.h" @implementation ViewController -