摘要: 转:http://blog.csdn.net/mars2639/article/details/7352540atomic和nonatomic用来决定编译器生成的getter和setter是否为原子操作。atomic 设置成员变量的@property属性时,默认为atomic,提供多线程安全。 在多线程环境下,原子操作是必要的,否则有可能引起错误的结果。加了atomic,setter函数会变成下面这样: {lock} if (property != newValue) { [property release]; property = [newValue re... 阅读全文
posted @ 2013-09-23 10:41 zhangze 阅读(209) 评论(0) 推荐(1) 编辑