I get the following error when compiling my app.
warning: class 'ConfigureViewController' does not implement the 'MPMediaPickerControllerDelegate' protocol
I know that it means I have to implement the delegate in the Controller.
i.e @interface ConfigureViewController : 开发者_如何学运维UIViewController <MPMediaPickerControllerDelegate>
However, my current controller already has a delegate implementation for <UITextFieldDelegate>
i.e @interface ConfigureViewController : UIViewController <UITextFieldDelegate>
How do I go around this issue?
Thanks, Tee
Just separate them by a comma: <MPMediaPickerControllerDelegate, UITextFieldDelegate>
One can implement multiple protocols by specifying multiple protocols in the class declaration.
In this case, in order to implement both MPMediaPickerControllerDelegate
and UITextFieldDelegate
, the class declaration would be:
@interface ConfigureViewController : UIViewController < UITextFieldDelegate, MPMediaPickerControllerDelegate >
精彩评论