Abhi | 2 Aug 2004 07:59

Re: What do you call an Obj-C method?

Xcode uses NSString -someMethod:arg: in the 
command-double-click-on-code menu.
- Abhi

On 02/08/2004, at 1:18 PM, Timothy J.Wood wrote:

>
>   If the class is implied, then either -someMethod:arg: or 
> +someMethod:arg:.  If the class isn't implied then I use -[ClassName 
> someMethod:arg:] or possibly -[ClassName(CategoryName) 
> someMethod:arg:].  Basically, what the compiler uses :)
>
> -tim
>
> On Aug 1, 2004, at 8:12 PM, David Dunham wrote:
>
>> So how do people refer to a specific method? I.e. if I want to say 
>> that the bug was in the someMethod:with:arguments method of a 
>> particular class (when it's implemented in several)? In C++, I'd say 
>> it's in SomeClass::someMethodWithArguments(); Java would replace the 
>> "::" with a period. I don't think I've run across a notation for this 
>> in Objective-C.
>
>
>
> _______________________________________________
> MacOSX-dev mailing list
> MacOSX-dev@...
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
(Continue reading)

David Dunham | 2 Aug 2004 18:15
Picon

Re: What do you call an Obj-C method?

On 1 Aug 2004, at 22:59, Abhi wrote:

> Xcode uses NSString -someMethod:arg: in the 
> command-double-click-on-code menu.

Not on my machine -- I'm seeing the "-[ClassName someMethod:arg:]" 
format. (Xcode 1.2)

David Dunham     A Sharp     david@...
Voice/Fax: 206 783 7404     http://a-sharp.com
"People seem to misinterpret complexity as sophistication" -- Niklaus 
Wirth
Abhi | 3 Aug 2004 01:47

Re: What do you call an Obj-C method?

Hey, when did that happen? Same on my machine too. I wonder when that 
changed... I think I like the old way better.
*shrug*
- Abhi

On 03/08/2004, at 2:15 AM, David Dunham wrote:

> On 1 Aug 2004, at 22:59, Abhi wrote:
>
>> Xcode uses NSString -someMethod:arg: in the 
>> command-double-click-on-code menu.
>
> Not on my machine -- I'm seeing the "-[ClassName someMethod:arg:]" 
> format. (Xcode 1.2)
>
> David Dunham     A Sharp     david@...
> Voice/Fax: 206 783 7404     http://a-sharp.com
> "People seem to misinterpret complexity as sophistication" -- Niklaus 
> Wirth
>
> _______________________________________________
> MacOSX-dev mailing list
> MacOSX-dev@...
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
>
Finlay Dobbie | 2 Aug 2004 11:07

Re: What do you call an Obj-C method?


On 2 Aug 2004, at 06:59, Abhi wrote:

> Xcode uses NSString -someMethod:arg: in the 
> command-double-click-on-code menu.

Xcode is wrong. ;-)

  -- Finlay
Andy Lee | 2 Aug 2004 17:57
Picon
Favicon

Re: What do you call an Obj-C method?

On Aug 2, 2004, at 5:07 AM, Finlay Dobbie wrote:
> On 2 Aug 2004, at 06:59, Abhi wrote:
>
>> Xcode uses NSString -someMethod:arg: in the 
>> command-double-click-on-code menu.
>
> Xcode is wrong. ;-)

I never noticed that about Xcode, probably because I've never used that 
feature.  I actually prefer the "wrong" way.  I think the +/- 
punctuation should go next to the thing it describes.  Plus, that's the 
way I'm used to seeing the method name in the absence of the class 
name: "-length".

It annoys me -- and it might just be me, because this is really trivial 
-- that "-[NSString length]" is a valid Objective-C expression whose 
meaning depends on context.  The same thing bugs me about the Java 
notation that was mentioned earlier -- the syntax for *mentioning* a 
method is the same as for *using* it.

Objective-C makes it easy to avoid this ambiguity, by putting the +/- 
next to the method name: "[NSString -length]".  That's how I do it in 
my documentation.  Now that I see Apple has set a precedent, I don't 
feel like so much of a rebel. :)

--Andy

Gmane