cacao
cacao copied to clipboard
Story for unowned pointers in collections
Both of the collection types (NSArray
and NSMutableDictionary
) only accept owned pointers to elements. This makes sense, but there are many types that are always shared (NSURL
, NSImage
, etc), which means we cannot store these elements in any collections. This prevents using some APIs and just generally is a bit weird.
Why are those types always unowned, and what would need to happen in order to properly add them to a collection without leaking?