關於子類和父類具備相同屬性的問題

若是父類中有delegate屬性,而且子類中也具備同名的屬性,那麼會報一下警告⚠️。解決辦法:在.m文件中添加:@dynamic delegate;具體請搜索動態綁定。以下圖:
blog

// Auto property synthesis will not synthesize property 'delegate'; it will be implemented by sit superclass,use @dynamic to acknowledge intentionit

相關文章
相關標籤/搜索