• 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: Core Data property declaration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data property declaration


  • Subject: Re: Core Data property declaration
  • From: Scott F Bayes <email@hidden>
  • Date: Fri, 2 Nov 2007 11:41:10 +0900


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:
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:
This email sent to email@hidden


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

  • Prev by Date: Re: CILinearGradient drawing backwards in 10.5
  • Next by Date: Re: CGDisplayBounds() with stacked displays...
  • Previous by thread: Re: Core Data property declaration
  • Next by thread: [NSOutlineView outlineView:isGroupItem] rendering issue
  • Index(es):
    • Date
    • Thread