The role of -supportsWeakPointers
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.Dunno. :)
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.
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.)
In your sample changing
supportsWeakPointers
toallowsWeakReference
as defined inNSObject.h
causes things to behave as one would expect. It's marked asNS_DEPRECATED
but it doesn't look like there is an alternative in the SDK yet.