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