Hi,
I am using the this code in my iPhone application:
UIButton * MyButton=[UIButton ButtonWithType:UIButtonTypeRoundRect]retain];
If I don't use this retain will my app crash? What is the function of this retain?
Hi,
I am using the this code in my iPhone application:
UIButton * MyButton=[UIButton ButtonWithType:UIButtonTypeRoundRect]retain];
If I don't use this retain will my app crash? What is the function of this retain?
You should retain because the UIButton object returned from the call is autoreleased.