I am trying to implement a protocol in Objective C.
@implementation UsingViewsViewController : UIViewController<UIAlertViewDelegate>
- (void)viewDidLoad
...
However, XCode issues an error: “Unexpected identifier or ‘(‘”.
The code compiles, however, if I take out <UIAlertViewDelegate>.
Why is it erring with the protocol notice?
You have your @interface and @implementation mixed up. Try:
Note that the @interface belongs in the header file, and the @implementation belongs in the .m file.