Re: [ANN] Cocoa Style for ObjC: 1 and 2
Re: [ANN] Cocoa Style for ObjC: 1 and 2
- Subject: Re: [ANN] Cocoa Style for ObjC: 1 and 2
- From: The Amazing Llama <email@hidden>
- Date: Fri, 29 Oct 2004 07:51:02 -0700
On Oct 28, 2004, at 8:00 PM, Roarke Lynch wrote:
On Oct 28, 2004, at 8:53 AM, Andreas Mayer wrote:
Am 27.10.2004 um 22:08 Uhr schrieb The Amazing Llama:
-infoForURL:
or
-infoWithURL:
although I'm still trying to decide which makes more sense, for or
with.
I'm using 'objectForX:' when X is just used to look up object and
'objectWithX:' when X will be added to / included in object.
I semi-agree. I would assume that infoForURL will return an object
which the receiver already owns, while infoWithURL would return a
newly created instance of info using URL in some fashion.
Once again, I'll come in and muddy the waters.
I have a parkWithName: object in a project I'm working on. It looks in
the parksByName dictionary, and if it finds something, it returns that.
If it doesn't, it creates the object, adds it to the dictionary, and
returns it. This follows the "when X will be included in object" idea,
because the park "owns" its name, even though that is also the key to
the dict. But it follows both Roarke's rules, so once again, this
proposal is too right.
Seth A. Roby The Amazing Llama < mail or AIM me at tallama at mac dot
com>
"Life is like an exploded clown. It's really funny until you figure out
what just happened."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden