objective-c - Objective-C ARC 中的(非原子、读写、保留)和(非原子、强)

标签 objective-c ios xcode automatic-ref-counting llvm

有什么不同吗?

假设和ARC中的一样,retain应该换成strong?

那么我可以说它们是相同的吗?

最佳答案

不,没有区别。按照我的回答here :

  • retain / strong: (automatically retains / releases values on set, makes sure values do not deallocate unexpectedly) (default if ARC and object type)

此外,readwrite 是属性的默认设置,因此没有必要,并且您已经指定了nonatomic

关于objective-c - Objective-C ARC 中的(非原子、读写、保留)和(非原子、强),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12113718/

相关文章:

ios - CoreLocation 不适用于 iOS 8 上的 Adhoc Distribution

ios - Yelp API ios 获取更大的图像

iphone - 如何获取核心数据中的关系项目属性?

ios - 在没有更多上下文的情况下使表达式类型不明确

ios - String 到 UIColor 的字典数组

xcode - 了解 Xcode 构建时间总结

ios - xCode 中的用户控件

ios - 在另一个 View Controller 中为 AVPlayer 创建播放/暂停按钮

ios - 拍摄照片并将其保存到相机胶卷

ios - UITextView 类,从 Objective-C 到 Swift 的 intrinsicContentSize 问题