Hello. After having read some literature on memory management, I am wondering whether the following code would be prone to retain cycle memory leaks:
class ClassA_VC: UIViewController
{
let objectB = ClassB()
func funcA()
{
let objectC = ClassC()
objectB.funcB()
objectC.funcC()
ClassD.funcD()
{
}
class ClassB
{
func funcB()
{
let objectC = ClassC()
objectC.funcC()
ClassD.funcD()
}
}
class ClassC
{
func funcC()
{
let objectB = ClassB()
objectB.funcB()
}
}
class ClassD
{
static func funcD()
{
let objectB = ClassB()
objectB.funcB()
}
}
Note that with the exception of object to ClassB in line 3, all other objects are initialized inside methods.
Thanks a lot!