When I do a hold on this object, this is 2. Why is this? Of course, this should be one, since I just initialized it and did not assign it or something else ...
let testC: TestClass = TestClass()
print(CFGetRetainCount(testC))
This was done in an empty project with one xcode view ... TestClass is an empty class, and viewcontroller is one instance of the instance, holding count is 2:


source
share