• 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: Graham Cox <email@hidden>
  • Date: Tue, 3 Nov 2009 12:13:41 +1100


On 03/11/2009, at 11:58 AM, 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 just a pointer. It even looks like one!



is it not possible to use dot notation here?

Yes, but since here the range is passed as pointer-to-range, you need to dereference:


*aRange.location = 0;

aRange->location = 0 is clearer, IMO.

--Graham


_______________________________________________

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


  • Follow-Ups:
    • Re: pointer to structure member reference?
      • From: Chunk 1978 <email@hidden>
References: 
 >pointer to structure member reference? (From: Chunk 1978 <email@hidden>)

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