• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [ANN] Cocoa Style for ObjC: 1 and 2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: [ANN] Cocoa Style for ObjC: 1 and 2
      • From: Scott Stevenson <email@hidden>
References: 
 >[ANN] Cocoa Style for ObjC: 1 and 2 (From: Scott Stevenson <email@hidden>)

  • Prev by Date: Re: NSURLConnection and 404s
  • Next by Date: Re: System Idle Time
  • Previous by thread: [ANN] Cocoa Style for ObjC: 1 and 2
  • Next by thread: Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Index(es):
    • Date
    • Thread