So my question is - is there a way to include the first label? I
note that the examples in the ObjectiveC manual seem to leave the
first one out also:
[myRect setWidth:10.0 :15.0]; ---> [myRect setWidth:10.0 height:
15.0];
No, it doesn't.
[myRect setOrigin:30.0 :50.0];
Here the method name, setOrigin::, has two colons, one for each of
its arguments. The arguments are inserted after the colons. This
method name uses unlabeled arguments. Unlabeled arguments make it
difficult to determine the kind and purpose of a method’s arguments.
Instead, method names should include labels describing each of their
arguments. Argument labels precede each colon in the method name.
The setWidth:height: method, for example, makes the purpose of its
two arguments clear:
Well now I'm a bit confused as I just used the same paragraph to show
that it does. Too much C++ thinking I guess. I'm thinking the method
name is setWidth with two arguments, one unlabeled and the other
labeled with 'height'. Any suggestions where I should brush up on this
- apart from the manual I'm looking at already?