NSArray property: copy or retain?

后端 未结 4 1571
醉话见心
醉话见心 2021-02-04 02:04

According to this: NSString property: copy or retain?

For NSString/NSMutableString, copy is recommended.

How about NSArray/NSMutableArray?

4条回答
  •  故里飘歌
    2021-02-04 02:44

    choose copy, unless you have a very specific reason not to, as well as all the supporting code/interface to back that up.

    i detailed the rationale and several implications here: NSMutableString as retain/copy

    that example is based on NSStrings, but the same applies for NSArrays.

提交回复
热议问题