IOS 小技巧 何时释放release UIBut…

来源:互联网 发布:淘宝组装机店铺大牌 编辑:程序博客网 时间:2024/06/04 23:24
是否在dealloc中对UIButton对象进行release操作,取决于UIButton初始化的方式。

如果使用[UIButtonbuttonWithType:UIButtonTypeRoundedRect]这种方式,是不需要进行release操作的,因为这种方式是自动释放的。如果使用[[UIButton alloc]init]的方式,则需要主动进行release释放操作。
0 0