views:

607

answers:

2

Hi, 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

+10  A: 

Just separate them by a comma: <MPMediaPickerControllerDelegate, UITextFieldDelegate>

Greg Martin
+7  A: 

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 >
coobird
Uh oh, that's easier than I thought.Thanks coobird
teepusink