The role of -supportsWeakPointers

  1. Consider the case of a class with both a "shared" or "default" instance and other instances (e.g. NSFileManager). Your shared instance likely has different weak pointer behavior from the other allocatable instances. There are times where different instances may want different weak pointer behavior. That having been said, if this is the case something's probably Not Quite Right.

    (Answer 1. was originally written by Chris Parker. I’m adding it to Joshua’s answer so that the accepted answer is complete.)

  2. In your sample changing supportsWeakPointers to allowsWeakReference as defined in NSObject.h causes things to behave as one would expect. It's marked as NS_DEPRECATED but it doesn't look like there is an alternative in the SDK yet.


  1. Consider the case of a class with both a "shared" or "default" instance and other instances (e.g. NSFileManager). Your shared instance likely has different weak pointer behavior from the other allocatable instances. There are times where different instances may want different weak pointer behavior. That having been said, if this is the case something's probably Not Quite Right.

  2. Dunno. :)

  3. Sounds like it might be a bug; I'd have to see a sample project to have a better idea of what's going on.