Sunday, February 12, 2012

About initWithFrame and buttonWithType

There's two way to init UIButton

1.init by buttonWithType
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = frame;

2.init by initWithFrame
UIButton *button = [[[UIButton alloc] initWithFrame:CGRectMake(0.0f,0.0f,100.0f,45.0f)] autorelease];