Given (arbitrarily):
CGRect frame = CGRectMake(0.0f, 0.0f, 100.0f, 30.0f);
What\'s the difference between the following two code snippets?<
I would strongly suggest using the first approach (+buttonWithType), because that's the only way to specify the button type.
If you +alloc and -initWithFrame:, the buttonType is set to some standard value (not sure which, and this could change in later versions of the SDK) and you can't change the type afterwards because the buttonType property is read only.