• 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: Calling objc_getAssociatedObject in -finalize.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling objc_getAssociatedObject in -finalize.


  • Subject: Re: Calling objc_getAssociatedObject in -finalize.
  • From: Greg Parker <email@hidden>
  • Date: Mon, 12 Mar 2012 09:50:05 -0700

On Mar 10, 2012, at 3:19 AM, email@hidden wrote:

> Consider a GC app.
> It is not safe to access object ivars during -finalize due to the uncertainty which self and the ivar objects will be finalised.
>
> Question:
> Is it safe to call objc_getAssociatedObject in -finalize or do the same caveats apply?
> I have no real idea how the collector treats such associated objects.
> My guess would be that it simply collects them like any other object and that objc_getAssociatedObject cannot be safely called in -finalize.

The same caveats apply. You can safely call objc_getAssociatedObject(), but the pointed-to objects may already have had their own -finalize methods called.


--
Greg Parker     email@hidden     Runtime Wrangler



_______________________________________________

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: 
 >Calling objc_getAssociatedObject in -finalize. (From: "email@hidden" <email@hidden>)

  • Prev by Date: Transition from [NSEvent phase] to [NSEvent momentumPhase]
  • Next by Date: Re: Forcing subclass creation through method swizzling not airtight?
  • Previous by thread: Calling objc_getAssociatedObject in -finalize.
  • Next by thread: Forcing subclass creation through method swizzling not airtight?
  • Index(es):
    • Date
    • Thread