NSString property: copy or retain?

前端 未结 10 1261
予麋鹿
予麋鹿 2020-11-22 02:53

Let\'s say I have a class called SomeClass with a string property name:

@interface SomeClass : NSObject
{
    NSString* name;
}

@p         


        
10条回答
  •  情书的邮戳
    2020-11-22 03:21

    If the string is very large then copy will affect performance and two copies of the large string will use more memory.

提交回复
热议问题