CFGetRetainCount returns 2 after creating an object, should be 1?

336 views Asked by At

When I do a retain count on this object it is 2. Why is this? Surely it should be one as I have just initialised it and not assigned it or anything...

let testC: TestClass = TestClass()
print(CFGetRetainCount(testC))

This was done in an empty single view xcode project...TestClass is an empty class and viewcontroller instantiates it once, retain count is 2:

View Controller creates one test class

empty class

0

There are 0 answers