0
// 1.
TestViewController <TestViewControllerProtocol> *testVC = [TestViewController new];
// 2.
TestViewController *testVC = [TestViewController new];
- 什么上述文献之间的区别是什么?
- 什么时候比第二个更好?
TestViewController.hObjective-C的 - 理解协议引用
@interface TestViewController : UIViewController <TestViewControllerProtocol>
1.附录中,您可以在接口“TestViewController”中看到始终实现“TestViewControllerProtocol”,所以即使2没有引用该协议,它仍然实现它? –
@PeterWarbo:那么没有什么区别 – newacct
所以第一个是声明它符合协议的方式,而不是在接口中实际做到这一点? –