忘備録

日々の調べ物をまとめる。アウトプットする。基本自分用。

【Objective-C】プロパティ名の制約

以下のようなコードを書いたところ。。。

hogehoge.h

@property NSString *newHoge;

Xcodeから以下のようにお叱りが。。。

Property follows Cocoa naming convention for returning 'owned' objects

んで、調べてみた

objective c - Semantic Issue: Property's synthesized getter follows Cocoa naming convention for returning 'owned' objects - Stack Overflow

You cannot give a property a name that begins with new or copy.

プロパティ名は「new」や「copy」で始めてはいけないそうです。