Reputation: 7625
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.
Upvotes: 2
Views: 3240
Reputation: 4170
The correct declaration for a class that implements multiple protocols is a comma separated list
@interface ViewController : UIViewController <UIWebViewDelegate, UITextFieldDelegate>
{ ...
Upvotes: 18