崩潰:Property follows Cocoa naming convention for returning 'owned' objects

定義屬性時,報了這個錯誤,如下:

錯誤信息

Property follows Cocoa naming convention for returning 'owned' objects

報錯位置

@interface ViewController ()

    @property(copy,nonatomic)NSMutableString *copyMutalbesString;

@end

原因

原因很簡單,OC的屬性命名,不得以alloc,new,copy,mutableCopy開頭。所以改個名字就行了。

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