Xcode: Auto property synthesis will not synthesize property 解決

  1. Auto property synthesis will not synthesize property ‘title’; it will be implemented by its superclass, use @dynamic to acknowledge intention

    這是說編譯器自動給屬性title合成getter和setter的時候將會在它的父類上實現,也就是說坑爹的xcode6.3升級後ios8.3版本的UIViewController裏有一個title屬性,現在它不知道到底是哪一個title.

    這不是我們想要的,所以添加 @dynamic告訴編譯器這個屬性是動態的,動態的意思是等你編譯的時候就知道了它只在本類合成;

    解決:

    @implementation SearchResultViewController
    @dynamic title;
    
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章