8

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

Ben Smith
  • 521
  • 3
  • 15

0 Answers0