Confused about a situation that might be a retain cycle?
I understand that if
class Object-A {
var b: Object-B }
and
class Object-B {
var a: Object-A
]
then above is horrible design because if you do
var a = Object-A()
var b = Object-B()
a.b = b
b.a = a
then this causes a retain cycle with two strong references pointing at each other.
But what if the situation is below?
class Object-A {
var b: Object-B
}
class Object-B {
var randomArrayProperty: [Object-B]
}
and you try to do
var a = Object-A()
var b = Object-B()
a.b = a
b.randomArrayProperty.append(a)
Is that a retain cycle as well?