What's the difference between the following two code snippets?
1.
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = frame;
2.
UIButton *button = [[[UIButton alloc] initWithFrame:frame] autorelease];
-buttonWithType:
UIButton
+[NSObject alloc]
0
buttonType
0
UIButtonTypeCustom
-buttonWithType:
buttonType
UIButtonTypeCustom
1
0
-initWithFrame
UIButton
+buttonWithType
+alloc
-initWithFrame:
buttonType
buttonType
标签:alloc,initWithFrame,frame,buttonWithType,buttonType,UIButton
From: https://blog.51cto.com/u_16124099/6326825