• 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: Accessing a property of a returned object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Accessing a property of a returned object? (From: Mark Teagarden <email@hidden>)
 >Re: Accessing a property of a returned object? (From: Nathan Kinsinger <email@hidden>)
 >Re: Accessing a property of a returned object? (From: Mark Teagarden <email@hidden>)

  • Prev by Date: Re: Accessing a property of a returned object?
  • Next by Date: Re: NSWindow resize problems
  • Previous by thread: Re: Accessing a property of a returned object?
  • Next by thread: Re: Accessing a property of a returned object?
  • Index(es):
    • Date
    • Thread