UIButton - alloc initWithFrame: vs. buttonWithType:

Дано (произвольно):

CGRect frame = CGRectMake(0.0f, 0.0f, 100.0f, 30.0f);

В чем разница между следующими двумя фрагментами кода?

1.

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

2.

    UIButton *button = [[[UIButton alloc] initWithFrame:frame] autorelease];
14
задан Cristik 12 May 2016 в 05:40
поделиться