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: Marco Scheurer <email@hidden>
- Date: Wed, 27 Oct 2004 01:50:12 +0200
On Oct 27, 2004, at 01:25, Scott Stevenson wrote:
I've just posted a two-part tutorial on style conventions for Cocoa
using Objective-C:
http://cocoadevcentral.com/articles/000082.php
http://cocoadevcentral.com/articles/000083.php
Nice. I agree with most if not all of them!
Here are two more naming conventions that I find useful:
- Naming observer selectors after the notification name. For instance
if I register to receive the notification named
'NSTaskDidTerminateNotification', the selector will be
@selector(taskDidTerminate:)
- Using 'each' in enumerations has the advantage of avoiding collisions
with other frequent variable names (and I prefer 'each' to 'one', could
also be applied to other loops), for instance,
NSEnumerator *nameEnumerator = [allNames objectEnumerator];
NSString *eachName;
while (eachName = [nameEnumerator nextObject]) {
...
}
Marco Scheurer
Sen:te, Lausanne, Switzerland
http://www.sente.ch
_______________________________________________
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