What does the property “Nonatomic” mean?

后端 未结 9 771
野趣味
野趣味 2020-12-04 05:16

What does \"nonatomic\" mean in this code?

@property(nonatomic, retain) UITextField *theUsersName;

What is the difference between atomic an

9条回答
  •  自闭症患者
    2020-12-04 05:47

    In a multi-threaded program, an atomic operation cannot be interrupted partially through, whereas nonatomic operations can.

    Therefore, you should use mutexes (or something like that) if you have a critical operation that is nonatomic that you don't want interrupted.

提交回复
热议问题