What’s the difference (if indeed there is a difference) between:
UITableViewCell *cell;
...
cell.textLabel.text = [self.adviceData objectAtIndex:indexPath.row];
and
UITableViewCell *cell;
...
NSString *text = [self.adviceData objectAtIndex:indexPath.row];
[cell.textLabel setText:text];
They both seem to do the same thing, but one has more brackets. Do the brackets do something?
The first one is just using the dot-notation syntax added in Objective-C 2.0. They both call the
setText:method on thetextLabel.By the way, here’s an article which will help you decide whether to use dot-notation syntax or not in your code.