- 博客(2)
- 收藏
- 关注
iOS问题研究之一:应该使用 instance variable还是property
JOHN GALLAGHER在博客里面说,多多建议使用property而很少使用ivar。原因有property更有利于debug和log,但是针对于performance来说,property要优于ivar,主要是ivar在get或是set方法中,调用objc_msgSend将函数名字存到寄存器中,而ivar则直接使用立即数放在寄存器直接操作,但这两种方式都是纳秒级别的,影响很...
2014-02-14 14:55:11
136
iOS性能优化之一:在Objective-C中遍历集合的性能
When enumerating an NSArray: Use for (id object in array) if enumerating forwards. Use for (id object in [array reverseObjectEnumerator]) if enumerating backwards. Use for (NSInteger i = 0; i < c...
2014-02-13 14:51:19
252
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅