Re: pointer to structure member reference?
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