NSSet contains strong references to its objects, so the Objective-C solution should have used NSHashTable.weakObjectsHashTable () a la
NSHashTable* mySet = [NSHashTable weakObjectsHashTable]; [mySet addObject:anyOldObject]; [mySet count];
in swift however this does not work
var mySet = NSHashTable.weakObjectsHashTable() mySet.addObject(anyOldObject) mySet.count
What am I missing? Or is it a mistake?
swift xcode6 foundation
Hammer
source share