Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a ViewController conform to multiple protocols?

I want to include Core Location and I'm trying to follow this tutorial: http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/ and I am using SDK 3.2.2.

@interface MainViewController : UIViewController <FlipsideViewControllerDelegate>{ is the code right now.

like image 511
Moshe Avatar asked Dec 22 '22 04:12

Moshe


1 Answers

If you want a class to conform to multiple protocols you just separate the protocol names in the <>s with commas:

@interface MyClass : TheSuperclass <Protocol1, Protocol2, Protocol3>
    ...
@end

and so forth.

In your case:

@interface MainViewController : UIViewController <FlipsideViewControllerDelegate, CLLocationManagerDelegate>
    ...
@end
like image 63
Alex Rozanski Avatar answered Jan 13 '23 13:01

Alex Rozanski