Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kiarashvosough1999/1557a01e92f60e7f5ee47974f0a9d9b8 to your computer and use it in GitHub Desktop.
Save kiarashvosough1999/1557a01e92f60e7f5ee47974f0a9d9b8 to your computer and use it in GitHub Desktop.
let hashTable = NSHashTable<NSString>.weakObjects()
var str: NSMutableString? = NSMutableString.init(string: "dasdasdas")
hashTable.add(str)
str = nil
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
print(hashTable.allObjects)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment