Re: Accessing a property of a returned object?
Re: Accessing a property of a returned object?
- Subject: Re: Accessing a property of a returned object?
- From: Nathan Kinsinger <email@hidden>
- Date: Sun, 27 Jul 2008 01:36:13 -0600
On Jul 27, 2008, at 1:24 AM, Mark Teagarden wrote:
Ah. I think I was under the impression that objectAtIndex was
already returning a pointer to an object of type Unit, in which
case the cast would be unnecessary. Is the actual object, or a copy
thereof, being returned? I thought that sort of thing was frowned
upon as wasteful.
In any event, thanks Nathan. I'll try that.
It's returning an object of type id, which is a generic object type.
You need to tell the complier what the actual type is so it knows
where to look for implementation details. At run time it will be a
pointer to the Unit object, not a copy or anything like that.
--Nathan
_______________________________________________
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