Instance Method

initWithFrame:style:

Initializes and returns a table view object having the given frame and style.

Declaration

- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style;

Parameters

frame

A rectangle specifying the initial location and size of the table view in its superview’€™s coordinates. The frame of the table view changes as table cells are added and deleted.

style

A constant that specifies the style of the table view. For a list of valid styles, see UITableViewStyle.

Return Value

Returns an initialized UITableView object.

Discussion

You must specify the style of a table view when you create it, and you cannot change that style later. If you initialize the table view with the UIView method initWithFrame:, the UITableViewStylePlain style is used as a default.

See Also

Creating a Table View