Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data property declaration




On Nov 2, 2007, at 10:32 , Erik Buck wrote:

[deleted]

Note the "*lastName".  The extra asterisk makes ALL
the difference in C, and the asterisk is NOT
associated with the type name, it is associated with
the variable and should/must be grouped with the
variable.

The * makes ALL the difference as you say, but it needn't be "grouped" in terms of textual format, just properly associated with the variable name. Assuming @property follows C syntactic rules. either of the following should be fine:


@property(retain) NSString *firstName,  *lastName;
@property(retain) NSString* firstName,  * lastName;

Though I like the first syntax better for aesthetic reasons (that second variable looks odd in the second line, with the * in empty space).

The mental trick I use to keep track of what associates with what in "typename *varname;" is: "*varname is an instance of typename, so varname is a reference to typename".

ScottB

Is the document correct or am I.  I am away from any
Leopard machine, so I can't just test it.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden
References: 
 >Core Data property declaration (From: Erik Buck <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.