property修饰关键字
生活随笔
收集整理的這篇文章主要介紹了
property修饰关键字
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
修飾符按作用區分:線程安全相關,內存相關,讀寫權限相關,set=和get=,是否可為空, class
一.默認值
@property NSArray *dataArray;默認的是:atomic,strong(有的文章寫的居然是assign,我認為還是strong),readwrite,nullable
二.線程相關
- atomic
- nonatomic
三.內存相關
- assgin
- weak
- unsafe_unretained
- retain
- strong
- copy
關于copy和mutableCopy使用效果,詳情見:http://www.cnblogs.com/shidaying/p/6926550.html
四.讀寫權限
- readwrite
- readonly
五.set=和get=
- set=
- get=
?
六.空與非空
- nonnull
- nullable
- null_resettable
- null_unspecified
七.class
- class
?
轉載于:https://www.cnblogs.com/shidaying/p/6960156.html
總結
以上是生活随笔為你收集整理的property修饰关键字的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android 软键盘自动弹出和关闭
- 下一篇: (延迟两秒,跳转相应页面)(返回到上一个