I know that. is a shortcut to the setter. Sometimes I use this code:
cell.textLabel.text = [NSString stringWithFormat:@"this is row %i", indexPath.row];
This works as expected, but I was wondering if it’s better (or rather, perhaps?) To write
cell.textLabel.text = [NSString stringWithFormat:@"this is row %i", [indexPath row]];
Or, in other words, you should use the point syntax only with the = operator, for example
aTextField.text = @"whatever";
Any links / documents are welcome, thanks :)
PS. If you do not see the tag, I'm talking about iOS here.
source
share