子类是否在Objective-C中继承其父类的协议?

eli*_*lon 22 inheritance protocols objective-c

假设我有一个实现协议的父类:

@interface GameViewController : UIViewController<GamePrizeDelegate> {
  ...
}
Run Code Online (Sandbox Code Playgroud)

然后我创建它的子类:

@interface TennisViewController : GameViewController {
  ...
}

@interface SoccerViewController : GameViewController {
  ...
}
Run Code Online (Sandbox Code Playgroud)

我是否必须GamePrizeDelegate在子类中包含?协议是否也继承了?

谢谢!

Nic*_*ver 29

参考Apple的文档:您的子类确实继承了协议的采用,因此您不必再次采用它.

符合协议

如果一个类采用协议或从另一个采用它的类继承,则认为该类符合正式协议 .据说类的实例符合其类符合的同一组协议.