Why/When do you use one over the other? I just ran into an issue where I got a warning using one and no warning when using the other.
tableView.tableHeaderView = label; // worked
[tableView tableHeaderView:label]; // did not work - "instance method '-tableHeaderView:' not found (return type defaults to 'id')"
setters are generally prefixed with
set. Try this instead:
That is to say, this:
tableView.tableHeaderView = label;
is converted to:
automatically by the compiler when using dot notation.
When declaring an objc property, this convention is also applied to the declared property name for the setter (again, by default).
Getters don't use this convention, Their selectors are the same (by default) as the declared property name:
view = tableView.tableHeaderView;
is equal to:
view = [tableView tableHeaderView];