• 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: pointer to structure member reference?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pointer to structure member reference?


  • Subject: Re: pointer to structure member reference?
  • From: Thomas Wetmore <email@hidden>
  • Date: Mon, 02 Nov 2009 20:07:08 -0500

Chuck,

NSRange and NSSize are C structures, not Objective-C objects. The -> operator is the C operator used to access structure fields from a structure pointer. You can use dot notation if you like:

(*aRange).location = 0;
(*aSize).height = 4.0;

But if you do so you are NOT using the new Objective-C dot notation, but only the "old" C dot notation.

You should probably take a look at a C reference book to understand fully.

Regards,

Tom Wetmore

On Nov 2, 2009, at 7:58 PM, Chunk 1978 wrote:

having a bit of a time understanding this:  ->

i think it's used to point to a member of a supplied argument of the method?

- (void)method:(NSRange *)aRange ofSize:(NSSize *)aSize
{
aRange->location = 0;
aSize->height = 4.0;
}

is it not possible to use dot notation here?
_______________________________________________

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: 
 >pointer to structure member reference? (From: Chunk 1978 <email@hidden>)

  • Prev by Date: pointer to structure member reference?
  • Next by Date: Re: Keeping NSTimeInterval updated with current time
  • Previous by thread: pointer to structure member reference?
  • Next by thread: Re: pointer to structure member reference?
  • Index(es):
    • Date
    • Thread