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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to