On 2008 Dec, 05, at 20:06, Jim Correia wrote:

Why would you refactor your code so that name is no longer a property?

Name is still a conceptually a property, but it is dependent on firstName and lastName, and read only now.

@property(nonatomic, readonly) NSString *name;  /* or fullName */

Yes, that's true Jim, I have used that readonly thing for dependent/ derived attributes, and it is likely that I would do as you just did. But when under stress, not guaranteed!

On 2008 Dec, 05, at 20:06, Bill Bumgarner wrote:

the dot syntax is 100% orthogonal to the @property syntax. Entirely independent of each other.

The only requirement of the . syntax is that the type -- the class -- of the object on the left side of the . must be known and must contain a declaration specifying the type to be set or returned, either through @property or through traditional method declarations.

When I read the "Dot Syntax" section in "The Objective-C 2.0 Programming Language" a few weeks ago, I could swear that it was under the "Properties". I remember this because I thought it was rather odd, since they seemed "orthogonal", as Bill says. Also, it was missing the precise requirement that Bill just stated.

However, when I looked at "The Objective-C 2.0 Programming Language" just now, I see that the "Dot Syntax" section is now under "Object Messaging", which is where it belongs. And it appears to have been greatly expanded to answer all of my questions.

Aha!  At the bottom I see "Last Updated: 2008-11-19".

So, my apologies -- this whole thread may have been caused by my not re-checking for the latest improved documentation...

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_2_section_4.html#/ /apple_ref/doc/uid/TP30001163-CH11-SW17

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to