Objective-c properties for primitive types

后端 未结 3 506
生来不讨喜
生来不讨喜 2020-12-30 10:56

In Objective-C Does it ever make sense to specify a property for a primitive type as nonatomic?

I\'m wondering about the difference between these two pr

3条回答
  •  天命终不由人
    2020-12-30 11:13

    Yes. nonatomic is not a memory-management keyword, it has to do with thread safety. Also, properties are atomic by default (without explicitly declaring them as nonatomic), so there is a difference between the two declarations you listed.

提交回复
热议问题