`
mirthor
  • 浏览: 1744 次
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
         JOHN GALLAGHER在博客里面说,多多建议使用property而很少使用ivar。原因有property更有利于debug和log,但是针对于performance来说,property要优于ivar,主要是ivar在get或是set方法中,调用objc_msgSend将函数名字存到寄存器中,而ivar则直接使用立即数放在寄存器直接操作,但这两种方式都是纳秒级别的,影响很小。所以为了便于log和debug,还是尽可能的使用property。 from:http://blog.bignerdranch.com/4005-should-i-use-a-property-o ...
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 < count; i++) if you need to know the index value, or need to modify the array. Try [array enumerateObjec ...
Global site tag (gtag.js) - Google Analytics