V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  zapper  ›  全部回复第 66 页 / 共 71 页
回复总数  1402
1 ... 58  59  60  61  62  63  64  65  66  67 ... 71  
个人觉得应该从"nonatomic: It is not thread-safe"理解这两个的区别。
http://stackoverflow.com/questions/588866/whats-the-difference-between-the-atomic-and-nonatomic-attributes
第二个回答中的代码片段看上去会比较好理解

atomic 是通过原子操作 set / return value 的,你在执行 getter / setter 之前会检查这个对象是否被其他线程占用。如果是,则会等待,既不能一次得到这个值。
nonatomic 直接 set / return value ,既是说如果声明为 nonatomic ,你在执行 getter / setter 消耗的时间中,你那个对象中的值可能已经变化掉了。虽然说他的速度会比 atomic 快,但是不是线程安全的。
2015-12-04 11:52:00 +08:00
回复了 vicky517 创建的主题 Android eclipse 项目转到 Android studio 过程正是痛苦。
长痛不如短痛
nonatomic: It is not thread-safe. You can use the nonatomic property attribute to specify that synthesized accessors simply set or return a value directly, with no guarantees about what happens if that same value is accessed simultaneously from different threads. For this reason, it ’ s faster to access a nonatomic property than an atomic one.

atomic : It is the default behaviour. If an object is declared as atomic then it becomes thread-safe. Thread-safe means, at a time only one thread of a particular instance of that class can have the control over that object.

这句话是描述 nonatomic 的吧..?
2015-11-19 11:18:01 +08:00
回复了 xingzhela 创建的主题 程序员 做技术的程序员是买魅蓝 metal 还是乐视 1s 啊
不知道是不是我的设置问题,新版 flyme 在程序崩溃的时候会自动重启程序(而且还不出现 FC 对话框).乐视没用过,不好评价.
2015-11-12 10:59:41 +08:00
回复了 nextoffer 创建的主题 推广 这个 Logo 有点酷 ಠ_ಠ
我第一眼还以为是把剑插在坑里
这个问题我在 6.x 时代好像都见过
是约束问题
2015-11-07 08:45:07 +08:00
回复了 andysheng 创建的主题 iDev 求推荐 autolayout 方面的文章
iOS Auto Layout 开发秘籍(第二版)
名字虽然听起来不咋地
2015-11-06 22:56:45 +08:00
回复了 z742364692 创建的主题 程序员 想问一下这是什么车,适合程序员开吗?
这个车 要敲代码才能点火的,熄火了很麻烦
2015-11-06 20:44:04 +08:00
回复了 freaks 创建的主题 Android Andriod Studio 要上 ssd 和 8g 内存吗?
@freaks 你编译的文件也要存在硬盘 并不止是启动速度.8G 应该是标准配置,16G 更像是一个推荐配置,一边开着 AS 一边查文档,8G 一下就满了的
2015-10-29 15:26:17 +08:00
回复了 sharpy 创建的主题 Xcode 你们的 xcode 有多大?
10.55G 比更大还大
2015-10-24 13:46:38 +08:00
回复了 greatdk 创建的主题 奇思妙想 为什么中国的程序员会把 1024 作为程序员节日?
请把这个消息转发 10 个群,然后看看你的头像,我试过了是真的。
这是在说*付宝吗
2015-10-17 17:31:26 +08:00
回复了 banxi1988 创建的主题 设计 Hi, 大家评价下这个手机的界面的设计。谢谢。
tab(难道是 tool?)bar 几个图标意味不明,而且这好像还是个二级页面,和下方冲突吧
2015-10-17 17:28:35 +08:00
回复了 acros 创建的主题 问与答 类肤质表面的电子产品是怎么清洗的?
类肤质久了会掉漆变得很恶心的....我的鼠标就掉了,后面干脆全磨下来变光面了
2015-10-16 11:21:13 +08:00
回复了 akring 创建的主题 Apple MBP 上的 Force touch 都有哪些用处?
重命名...
2015-10-13 20:02:00 +08:00
回复了 ma 创建的主题 问与答 触摸板鼠标会漂移 有人知道是怎么回事吗
触摸板设定了加速吧(猜测)
2015-10-13 13:48:43 +08:00
回复了 wlee1991 创建的主题 问与答 有没有性价比好的升级 Macbook Pro 硬盘容量的方案?
SD 卡
至少留个简历吧...
其实技术也挺辛苦,不知道 LZ 女友吃不吃得消
我建议你可以找本测试技术的书周末和她一起摸索下,如果觉得可以就深入,既能探个底又能陪女友...
1 ... 58  59  60  61  62  63  64  65  66  67 ... 71  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2771 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 59ms · UTC 02:44 · PVG 10:44 · LAX 19:44 · JFK 22:44
Developed with CodeLauncher
♥ Do have faith in what you're doing.