摘要:
前几天去面试,被问到了NSString属性声明中的copy和retain具体区别,对内存计数的影响,汗,当时没整明白,也没答出来,只知道NSString一般用copy.首先做以下几个变量声明:@property (retain, nonatomic) NSString *retainStr;@property (copy, nonatomic) NSString *copyStr;@property (retain, nonatomic) NSMutableString *retainMStr;@property (copy, nonatomic) NSMutableString *cop.. 阅读全文