Re: Cocoa Style Question
Re: Cocoa Style Question
- Subject: Re: Cocoa Style Question
- From: "John C. Randolph" <email@hidden>
- Date: Thu, 31 Mar 2005 10:32:44 -0800
On Mar 31, 2005, at 10:19 AM, Adam wrote:
What is considered good cocoa style? I am sometimes tempted to be
efficient and code like:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(sendCommandToSocket:)
name:@"AGFIBSSendCommandToSocket" object:nil];
Is it better to be more clear like and break things down:
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self selector:@selector(sendCommandToSocket:)
name:@"AGFIBSSendCommandToSocket" object:nil];
It's really just a matter of taste. I often write code in the more
verbose manner, and then condense it after I've gotten it working.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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