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 : UIV开发者_如何学GoiewController <FlipsideViewControllerDelegate>{
is the code right now.
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
@interface MainViewController : UIViewController <FlipsideViewControllerDelegate, CLLocationManagerDelegate>{
精彩评论