views:

135

answers:

1

This is a simple question that can be answered fast by someone who's more familiar with Objective-C than I am- how can one add more than 2 delegates to a Class?

To clarify, I'm used to putting delegates in classes like this:

@interface ViewController : UIViewController <UIWebViewDelegate> { ...

When I try to put two delegates:

@interface ViewController : UIViewController <UIWebViewDelegate> <UITextFieldDelegate> { ...

...the app gives many errors, none of which help with the situation.

Is there a separator that I need to put between the delegates, or is it possible at all to have more than two?

Thanks for any help in advance.

+5  A: 

The correct declaration for a class that implements multiple protocols is a comma separated list

@interface ViewController : UIViewController <UIWebViewDelegate, UITextFieldDelegate>
{ ...
falconcreek
Oh, so that's it- thanks a lot for the help.
Chromium
Glad to help. Suggest that you update the wording of the question to be inline with the objective-c terminology. @protocol is analogous to the Interface keyword in othe OO languages. When reading declarations the ":" is shorthand for "subclasses" and the "<>" is shorthand for "implements".
falconcreek