Hidden.Alpha.Opaque的区别 在iOS中,每个View都有Hidden.Alpha.Opaque三个关于透明的属性,官方文档介绍如下: 1. @property(nonatomic) CGFloat alpha; This value affects only the current view and does not affect any of its embedded subviews.Changes to this property can be animated. 2.
想到要如何为所有的对象增加实例变量吗?我们知道,使用Category可以很方便地为现有的类增加方法,但却无法直接增加实例变量.不过从Mac OS X v10.6开始,系统提供了Associative References,这个问题就很容易解决了.这种方法也就是所谓的关联(association),我们可以在runtime期间动态地添加任意多的属性,并且随时读取.所用到的两个重要runtime API是: 1 OBJC_EXPORT void objc_setAssociatedObject(id