我得到了那个错误:
/business/Dropbox/badgers/BadgerNew/BGProfileView.m:56:17: Auto property synthesis will not synthesize property declared in a protocol
我知道自动属性合成不会合成协议中声明的属性
所以我综合了我的自我。
这是协议:
@protocol BGIhaveNavigationController <NSObject>
@property (readonly)UINavigationController * navigationController;//This is the problematic property
@end
@protocol BGCommonProtocol <NSObject>
@end
至于执行
@interface BGProfileView : UIViewController
@end
是一个 UIViewController 并且我们知道 UIViewController 有一个 navigationController 属性。那么有什么问题呢?
当我使用它时,事情会出现问题:
@interface BGProfileView () <BGReviewsTableDelegateProtocol>
BGReviewsTableDelegateProtocol 协议继承 BGIhaveNavigationController 协议
我可以通过添加删除警告:
-(UINavigationController *) navigationController
{
return self.navigationController;
}
但这是荒谬的。从某种意义上说
-(UINavigationController *) navigationController
{
return self.navigationController;
}
-(UINavigationController *) navigationController
已经通过 UINavigationController 存在